diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-04-07 01:41:48 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-07 01:41:48 -0400 |
commit | 6d0c554cbb36bbfda786fb2e4b12239af91781cb (patch) | |
tree | 940a40cef637750b36536a422a91c91020fe045d | |
parent | 9b0627617ab35daf34f051352f3a6f05898ca935 (diff) | |
parent | 6d984739458511f444e80f06f6a12dd400268372 (diff) | |
download | podman-6d0c554cbb36bbfda786fb2e4b12239af91781cb.tar.gz podman-6d0c554cbb36bbfda786fb2e4b12239af91781cb.tar.bz2 podman-6d0c554cbb36bbfda786fb2e4b12239af91781cb.zip |
Merge pull request #9934 from alvistack/master-linux-amd64
Update nix pin with `make nixpkgs`
-rw-r--r-- | Makefile | 7 | ||||
-rw-r--r-- | nix/default-arm64.nix | 69 | ||||
-rw-r--r-- | nix/default.nix | 16 | ||||
-rw-r--r-- | nix/nixpkgs.json | 8 |
4 files changed, 90 insertions, 10 deletions
@@ -242,8 +242,11 @@ bin/podman.cross.%: .gopathok # Update nix/nixpkgs.json its latest stable commit .PHONY: nixpkgs nixpkgs: - @nix run -f channel:nixos-20.09 nix-prefetch-git -c nix-prefetch-git \ - --no-deepClone https://github.com/nixos/nixpkgs > nix/nixpkgs.json + @nix run \ + -f channel:nixos-20.09 nix-prefetch-git \ + -c nix-prefetch-git \ + --no-deepClone \ + https://github.com/nixos/nixpkgs refs/head/nixos-20.09 > nix/nixpkgs.json # Build statically linked binary .PHONY: static diff --git a/nix/default-arm64.nix b/nix/default-arm64.nix new file mode 100644 index 000000000..3e374c1bd --- /dev/null +++ b/nix/default-arm64.nix @@ -0,0 +1,69 @@ +let + pkgs = (import ./nixpkgs.nix { + crossSystem = { + config = "aarch64-unknown-linux-gnu"; + }; + config = { + packageOverrides = pkg: { + gpgme = (static pkg.gpgme); + libassuan = (static pkg.libassuan); + libgpgerror = (static pkg.libgpgerror); + libseccomp = (static pkg.libseccomp); + glib = (static pkg.glib).overrideAttrs (x: { + outputs = [ "bin" "out" "dev" ]; + mesonFlags = [ + "-Ddefault_library=static" + "-Ddevbindir=${placeholder ''dev''}/bin" + "-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 + ''; + }); + }; + }; + }); + + static = pkg: pkg.overrideAttrs (x: { + doCheck = false; + configureFlags = (x.configureFlags or [ ]) ++ [ + "--without-shared" + "--disable-shared" + ]; + dontDisableStatic = true; + enableSharedExecutables = false; + enableStatic = true; + }); + + self = with pkgs; buildGoModule rec { + name = "podman"; + src = ./..; + vendorSha256 = null; + doCheck = false; + enableParallelBuilding = true; + outputs = [ "out" ]; + nativeBuildInputs = [ bash gitMinimal go-md2man installShellFiles makeWrapper pkg-config which ]; + buildInputs = [ glibc glibc.static gpgme libassuan libgpgerror libseccomp libapparmor libselinux ]; + prePatch = '' + export CFLAGS='-static -pthread' + export LDFLAGS='-s -w -static-libgcc -static' + export EXTRA_LDFLAGS='-s -w -linkmode external -extldflags "-static -lm"' + export BUILDTAGS='static netgo osusergo exclude_graphdriver_btrfs exclude_graphdriver_devicemapper seccomp apparmor selinux' + ''; + buildPhase = '' + patchShebangs . + make bin/podman + make bin/podman-remote + ''; + installPhase = '' + install -Dm755 bin/podman $out/bin/podman + install -Dm755 bin/podman-remote $out/bin/podman-remote + ''; + }; +in +self diff --git a/nix/default.nix b/nix/default.nix index 7745d8b50..aae520c9e 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -7,7 +7,7 @@ let libassuan = (static pkg.libassuan); libgpgerror = (static pkg.libgpgerror); libseccomp = (static pkg.libseccomp); - glib = (static pkg.glib).overrideAttrs(x: { + glib = (static pkg.glib).overrideAttrs (x: { outputs = [ "bin" "out" "dev" ]; mesonFlags = [ "-Ddefault_library=static" @@ -15,14 +15,21 @@ 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 + ''; }); }; }; }); - static = pkg: pkg.overrideAttrs(x: { + static = pkg: pkg.overrideAttrs (x: { doCheck = false; - configureFlags = (x.configureFlags or []) ++ [ + configureFlags = (x.configureFlags or [ ]) ++ [ "--without-shared" "--disable-shared" ]; @@ -56,4 +63,5 @@ let install -Dm755 bin/podman-remote $out/bin/podman-remote ''; }; -in self +in +self diff --git a/nix/nixpkgs.json b/nix/nixpkgs.json index cc8daf55c..8d2f76a28 100644 --- a/nix/nixpkgs.json +++ b/nix/nixpkgs.json @@ -1,9 +1,9 @@ { "url": "https://github.com/nixos/nixpkgs", - "rev": "f38b9b258f3f4db5ecf7dd27a7d5b48f23202843", - "date": "2021-03-07T14:22:16+01:00", - "path": "/nix/store/df3v1b2qfsbnsd6fwaw4787qdy5rcxkc-nixpkgs", - "sha256": "1dbi7rjyfkv3rw6zqwbc6jknbdgyv16cd8zgcpq5gdj0mwnp9b13", + "rev": "42a03e4728fc05cb9f123057670e41967f628360", + "date": "2021-04-02T23:08:32+02:00", + "path": "/nix/store/d1vqa0kpa69zzcaj5kqgkmrxr3s7vli1-nixpkgs", + "sha256": "0wrn5nayxckj11z2qlvsya2lzssbccbk50llxmgdm0qb5y14shfk", "fetchSubmodules": false, "deepClone": false, "leaveDotGit": false |