Skip to content

Commit

Permalink
Merge pull request #1305 from alvistack/master-linux-amd64
Browse files Browse the repository at this point in the history
Update nix pin with `make nixpkgs`
  • Loading branch information
vrothberg authored Jun 3, 2021
2 parents 780de35 + 10c4c87 commit ec13aa6
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,10 @@ binary: cmd/skopeo
.PHONY: nixpkgs
nixpkgs:
@nix run \
-f channel:nixos-20.09 nix-prefetch-git \
-f channel:nixos-21.05 nix-prefetch-git \
-c nix-prefetch-git \
--no-deepClone \
https://github.com/nixos/nixpkgs refs/heads/nixos-20.09 > nix/nixpkgs.json
https://github.com/nixos/nixpkgs refs/heads/nixos-21.05 > nix/nixpkgs.json

# Build statically linked binary
.PHONY: static
Expand Down
32 changes: 30 additions & 2 deletions nix/default-arm64.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,25 @@ let
crossSystem = {
config = "aarch64-unknown-linux-gnu";
};
overlays = [
(final: pkg: {
pcre = (static pkg.pcre).overrideAttrs (x: {
configureFlags = x.configureFlags ++ [
"--enable-static"
];
});
})
];
config = {
packageOverrides = pkg: {
autogen = (static pkg.autogen);
e2fsprogs = (static pkg.e2fsprogs);
gnupg = (static pkg.gnupg);
gpgme = (static pkg.gpgme);
libassuan = (static pkg.libassuan);
libgpgerror = (static pkg.libgpgerror);
libseccomp = (static pkg.libseccomp);
libuv = (static pkg.libuv);
glib = (static pkg.glib).overrideAttrs (x: {
outputs = [ "bin" "out" "dev" ];
mesonFlags = [
Expand All @@ -25,6 +38,21 @@ let
-i "$dev"/include/glib-2.0/gobject/gobjectnotifyqueue.c
'';
});
gnutls = (static pkg.gnutls).overrideAttrs (x: {
configureFlags = (x.configureFlags or [ ]) ++ [
"--disable-non-suiteb-curves"
"--disable-openssl-compatibility"
"--disable-rpath"
"--enable-local-libopts"
"--without-p11-kit"
];
});
systemd = (static pkg.systemd).overrideAttrs (x: {
outputs = [ "out" "dev" ];
mesonFlags = x.mesonFlags ++ [
"-Dstatic-libsystemd=true"
];
});
};
};
});
Expand All @@ -47,8 +75,8 @@ let
doCheck = false;
enableParallelBuilding = true;
outputs = [ "out" ];
nativeBuildInputs = [ bash gitMinimal go-md2man installShellFiles makeWrapper pkg-config which ];
buildInputs = [ glibc glibc.static gpgme libassuan libgpgerror libseccomp ];
nativeBuildInputs = [ bash go-md2man installShellFiles makeWrapper pcre pkg-config which ];
buildInputs = [ glibc glibc.static glib gpgme libassuan libgpgerror libseccomp ];
prePatch = ''
export CFLAGS='-static -pthread'
export LDFLAGS='-s -w -static-libgcc -static'
Expand Down
32 changes: 30 additions & 2 deletions nix/default.nix
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
{ system ? builtins.currentSystem }:
let
pkgs = (import ./nixpkgs.nix {
overlays = [
(final: pkg: {
pcre = (static pkg.pcre).overrideAttrs (x: {
configureFlags = x.configureFlags ++ [
"--enable-static"
];
});
})
];
config = {
packageOverrides = pkg: {
autogen = (static pkg.autogen);
e2fsprogs = (static pkg.e2fsprogs);
gnupg = (static pkg.gnupg);
gpgme = (static pkg.gpgme);
libassuan = (static pkg.libassuan);
libgpgerror = (static pkg.libgpgerror);
libseccomp = (static pkg.libseccomp);
libuv = (static pkg.libuv);
glib = (static pkg.glib).overrideAttrs (x: {
outputs = [ "bin" "out" "dev" ];
mesonFlags = [
Expand All @@ -23,6 +36,21 @@ let
-i "$dev"/include/glib-2.0/gobject/gobjectnotifyqueue.c
'';
});
gnutls = (static pkg.gnutls).overrideAttrs (x: {
configureFlags = (x.configureFlags or [ ]) ++ [
"--disable-non-suiteb-curves"
"--disable-openssl-compatibility"
"--disable-rpath"
"--enable-local-libopts"
"--without-p11-kit"
];
});
systemd = (static pkg.systemd).overrideAttrs (x: {
outputs = [ "out" "dev" ];
mesonFlags = x.mesonFlags ++ [
"-Dstatic-libsystemd=true"
];
});
};
};
});
Expand All @@ -45,8 +73,8 @@ let
doCheck = false;
enableParallelBuilding = true;
outputs = [ "out" ];
nativeBuildInputs = [ bash gitMinimal go-md2man installShellFiles makeWrapper pkg-config which ];
buildInputs = [ glibc glibc.static gpgme libassuan libgpgerror libseccomp ];
nativeBuildInputs = [ bash go-md2man installShellFiles makeWrapper pcre pkg-config which ];
buildInputs = [ glibc glibc.static glib gpgme libassuan libgpgerror libseccomp ];
prePatch = ''
export CFLAGS='-static -pthread'
export LDFLAGS='-s -w -static-libgcc -static'
Expand Down
8 changes: 4 additions & 4 deletions nix/nixpkgs.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"url": "https://github.com/nixos/nixpkgs",
"rev": "eb7e1ef185f6c990cda5f71fdc4fb02e76ab06d5",
"date": "2021-05-05T23:16:00+02:00",
"path": "/nix/store/a98lkhjlsqh32ic2kkrv5kkik6jy25wh-nixpkgs",
"sha256": "1ibz204c41g7baqga2iaj11yz9l75cfdylkiqjnk5igm81ivivxg",
"rev": "eaba7870ffc3400eca4407baa24184b7fe337ec1",
"date": "2021-06-02T10:22:59+02:00",
"path": "/nix/store/lcr7kwnx934b1z6wmb1zlqjycdlbaw9x-nixpkgs",
"sha256": "115disiz4b08iw46cidc7lm0advrxn5g2ldmlrxd53zf03skyb2w",
"fetchSubmodules": false,
"deepClone": false,
"leaveDotGit": false
Expand Down

0 comments on commit ec13aa6

Please sign in to comment.