diff --git a/nix/default-arm64.nix b/nix/default-arm64.nix index 3f64caed5d..b3218af308 100644 --- a/nix/default-arm64.nix +++ b/nix/default-arm64.nix @@ -27,6 +27,16 @@ let -i "$dev"/include/glib-2.0/gobject/gobjectnotifyqueue.c ''; }); + pcsclite = (static pkg.pcsclite).overrideAttrs (x: { + configureFlags = [ + "--enable-confdir=/etc" + "--enable-usbdropdir=/var/lib/pcsc/drivers" + "--disable-libsystemd" + "--disable-libudev" + "--disable-libusb" + ]; + buildInputs = [ pkgs.python3 pkgs.dbus ]; + }); libcap = (static pkg.libcap).overrideAttrs (x: { postInstall = '' mkdir -p "$doc/share/doc/${x.pname}-${x.version}" @@ -38,6 +48,7 @@ let systemd = (static pkg.systemd).overrideAttrs (x: { outputs = [ "out" "dev" ]; mesonFlags = x.mesonFlags ++ [ + "-Dglib=false" "-Dstatic-libsystemd=true" ]; }); @@ -68,15 +79,8 @@ let doCheck = false; enableParallelBuilding = true; outputs = [ "out" ]; - nativeBuildInputs = with buildPackages; [ - autoreconfHook - bash - gitMinimal - pkg-config - python3 - which - ]; - buildInputs = [ glibc glibc.static libcap libseccomp protobufc systemd yajl ]; + nativeBuildInputs = [ autoreconfHook bash gitMinimal pkg-config python3 which ]; + buildInputs = [ glibc glibc.static glib libcap libseccomp protobufc systemd yajl ]; configureFlags = [ "--enable-static" ] ++ lib.optional (!enableSystemd) [ "--disable-systemd" ]; prePatch = '' diff --git a/nix/default.nix b/nix/default.nix index fe8e23e149..a0a456e810 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -9,7 +9,7 @@ let libgpgerror = (static pkg.libgpgerror); libseccomp = (static pkg.libseccomp); protobufc = (static pkg.protobufc); - glib = (static pkg.glib).overrideAttrs(x: { + glib = (static pkg.glib).overrideAttrs (x: { outputs = [ "bin" "out" "dev" ]; mesonFlags = [ "-Ddefault_library=static" @@ -17,8 +17,25 @@ let "-Dgtk_doc=false" "-Dnls=disabled" ]; + postInstall = '' + moveToOutput "share/glib-2.0" "$dev" + substituteInPlace "$dev/bin/gdbus-codegen" --replace "$out" "$dev" + sed -i "$dev/bin/glib-gettextize" -e "s|^gettext_dir=.*|gettext_dir=$dev/share/glib-2.0/gettext|" + sed '1i#line 1 "${x.pname}-${x.version}/include/glib-2.0/gobject/gobjectnotifyqueue.c"' \ + -i "$dev"/include/glib-2.0/gobject/gobjectnotifyqueue.c + ''; + }); + pcsclite = (static pkg.pcsclite).overrideAttrs (x: { + configureFlags = [ + "--enable-confdir=/etc" + "--enable-usbdropdir=/var/lib/pcsc/drivers" + "--disable-libsystemd" + "--disable-libudev" + "--disable-libusb" + ]; + buildInputs = [ pkgs.python3 pkgs.dbus ]; }); - libcap = (static pkg.libcap).overrideAttrs(x: { + libcap = (static pkg.libcap).overrideAttrs (x: { postInstall = '' mkdir -p "$doc/share/doc/${x.pname}-${x.version}" cp License "$doc/share/doc/${x.pname}-${x.version}/" @@ -26,13 +43,14 @@ let mv "$lib"/lib/security "$pam/lib" ''; }); - systemd = (static pkg.systemd).overrideAttrs(x: { + systemd = (static pkg.systemd).overrideAttrs (x: { outputs = [ "out" "dev" ]; mesonFlags = x.mesonFlags ++ [ + "-Dglib=false" "-Dstatic-libsystemd=true" ]; }); - yajl = (static pkg.yajl).overrideAttrs(x: { + yajl = (static pkg.yajl).overrideAttrs (x: { preConfigure = '' export CMAKE_STATIC_LINKER_FLAGS="-static" ''; @@ -41,9 +59,9 @@ let }; }); - static = pkg: pkg.overrideAttrs(x: { + static = pkg: pkg.overrideAttrs (x: { doCheck = false; - configureFlags = (x.configureFlags or []) ++ [ + configureFlags = (x.configureFlags or [ ]) ++ [ "--without-shared" "--disable-shared" ]; @@ -60,7 +78,7 @@ let enableParallelBuilding = true; outputs = [ "out" ]; nativeBuildInputs = [ autoreconfHook bash gitMinimal pkg-config python3 which ]; - buildInputs = [ glibc glibc.static criu libcap libseccomp protobufc systemd yajl ]; + buildInputs = [ glibc glibc.static glib criu libcap libseccomp protobufc systemd yajl ]; configureFlags = [ "--enable-static" ] ++ lib.optional (!enableSystemd) [ "--disable-systemd" ]; prePatch = '' @@ -78,4 +96,5 @@ let install -Dm755 crun $out/bin/crun ''; }; -in self +in +self diff --git a/nix/nixpkgs.json b/nix/nixpkgs.json index 356ef12b00..efcfe202e0 100644 --- a/nix/nixpkgs.json +++ b/nix/nixpkgs.json @@ -1,9 +1,9 @@ { "url": "https://github.com/nixos/nixpkgs", - "rev": "e02ced5c2027a0840e5d22d7bb6e67238f6b5fe9", - "date": "2021-02-17T17:38:12+01:00", - "path": "/nix/store/gvnxnfnikdsnadq9y9kabcshm72b8f0g-nixpkgs", - "sha256": "16x5yj4i0g6d7hqx865fdazdida03r8vyixcn3byxbhb2iv861lv", + "rev": "2a96414d7e350160a33ed0978449c9ff5b5a6eb3", + "date": "2021-07-13T18:21:47+02:00", + "path": "/nix/store/2ai9q8ac6vxb2rrngdz82y8jxnk15cvm-nixpkgs", + "sha256": "1dzrfqdjq3yq5jjskiqflzy58l2xx6059gay9p1k07zrlm1wigy5", "fetchSubmodules": false, "deepClone": false, "leaveDotGit": false diff --git a/nix/nixpkgs.nix b/nix/nixpkgs.nix index 21e7f17a2e..11c20380a6 100644 --- a/nix/nixpkgs.nix +++ b/nix/nixpkgs.nix @@ -5,4 +5,5 @@ let url = "${json.url}/archive/${json.rev}.tar.gz"; inherit (json) sha256; }); -in nixpkgs +in +nixpkgs