depot/third_party/nixpkgs/pkgs/development/libraries/libglibutil/default.nix
Default email 60f07311b9 Project import generated by Copybara.
GitOrigin-RevId: f8e2ebd66d097614d51a56a755450d4ae1632df1
2024-02-06 17:22:34 -08:00

49 lines
1.2 KiB
Nix

{ stdenv, lib, fetchFromGitHub, pkg-config, glib }:
stdenv.mkDerivation rec {
pname = "libglibutil";
version = "1.0.76";
src = fetchFromGitHub {
owner = "sailfishos";
repo = pname;
rev = version;
sha256 = "sha256-qp3zcaoLM6G3DZgb2Jic1OhHetraEmYRiGkbQlSBnjs=";
};
outputs = [ "out" "dev" ];
nativeBuildInputs = [
pkg-config
];
buildInputs = [
glib
];
postPatch = ''
# Fix pkg-config name for cross-compilation
substituteInPlace Makefile --replace "pkg-config" "$PKG_CONFIG"
'';
makeFlags = [
"LIBDIR=$(out)/lib"
"INSTALL_INCLUDE_DIR=$(dev)/include/gutil"
"INSTALL_PKGCONFIG_DIR=$(dev)/lib/pkgconfig"
];
installTargets = [ "install" "install-dev" ];
postInstall = ''
sed -i -e "s@includedir=/usr@includedir=$dev@g" $dev/lib/pkgconfig/$pname.pc
sed -i -e "s@Cflags: @Cflags: $($PKG_CONFIG --cflags glib-2.0) @g" $dev/lib/pkgconfig/$pname.pc
'';
meta = {
description = "Library of glib utilities.";
homepage = "https://git.sailfishos.org/mer-core/libglibutil";
license = lib.licenses.bsd3;
platforms = lib.platforms.linux;
maintainers = with lib.maintainers; [ mcaju ];
};
}