1
0
mirror of https://github.com/containers/skopeo.git synced 2025-05-03 13:36:59 +00:00

Update nix pin with make nixpkgs

- Bugfix `make nixpkgs` which pin with branch `nixos-21.05`
  - Code lint with `nixpkgs-fmt`
  - Code sync between x86\_64 and aarch64

Signed-off-by: Wong Hoi Sing Edison <hswong3i@pantarei-design.com>
This commit is contained in:
Wong Hoi Sing Edison 2021-06-03 11:16:15 +08:00
parent a07f1e0f89
commit 10c4c877ba
No known key found for this signature in database
GPG Key ID: 0F0D6A60644E28D3
4 changed files with 66 additions and 10 deletions

View File

@ -116,10 +116,10 @@ binary: cmd/skopeo
.PHONY: nixpkgs .PHONY: nixpkgs
nixpkgs: nixpkgs:
@nix run \ @nix run \
-f channel:nixos-20.09 nix-prefetch-git \ -f channel:nixos-21.05 nix-prefetch-git \
-c nix-prefetch-git \ -c nix-prefetch-git \
--no-deepClone \ --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 # Build statically linked binary
.PHONY: static .PHONY: static

View File

@ -3,12 +3,25 @@ let
crossSystem = { crossSystem = {
config = "aarch64-unknown-linux-gnu"; config = "aarch64-unknown-linux-gnu";
}; };
overlays = [
(final: pkg: {
pcre = (static pkg.pcre).overrideAttrs (x: {
configureFlags = x.configureFlags ++ [
"--enable-static"
];
});
})
];
config = { config = {
packageOverrides = pkg: { packageOverrides = pkg: {
autogen = (static pkg.autogen);
e2fsprogs = (static pkg.e2fsprogs);
gnupg = (static pkg.gnupg);
gpgme = (static pkg.gpgme); gpgme = (static pkg.gpgme);
libassuan = (static pkg.libassuan); libassuan = (static pkg.libassuan);
libgpgerror = (static pkg.libgpgerror); libgpgerror = (static pkg.libgpgerror);
libseccomp = (static pkg.libseccomp); libseccomp = (static pkg.libseccomp);
libuv = (static pkg.libuv);
glib = (static pkg.glib).overrideAttrs (x: { glib = (static pkg.glib).overrideAttrs (x: {
outputs = [ "bin" "out" "dev" ]; outputs = [ "bin" "out" "dev" ];
mesonFlags = [ mesonFlags = [
@ -25,6 +38,21 @@ let
-i "$dev"/include/glib-2.0/gobject/gobjectnotifyqueue.c -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"
];
});
}; };
}; };
}); });
@ -47,8 +75,8 @@ let
doCheck = false; doCheck = false;
enableParallelBuilding = true; enableParallelBuilding = true;
outputs = [ "out" ]; outputs = [ "out" ];
nativeBuildInputs = [ bash gitMinimal go-md2man installShellFiles makeWrapper pkg-config which ]; nativeBuildInputs = [ bash go-md2man installShellFiles makeWrapper pcre pkg-config which ];
buildInputs = [ glibc glibc.static gpgme libassuan libgpgerror libseccomp ]; buildInputs = [ glibc glibc.static glib gpgme libassuan libgpgerror libseccomp ];
prePatch = '' prePatch = ''
export CFLAGS='-static -pthread' export CFLAGS='-static -pthread'
export LDFLAGS='-s -w -static-libgcc -static' export LDFLAGS='-s -w -static-libgcc -static'

View File

@ -1,12 +1,25 @@
{ system ? builtins.currentSystem }: { system ? builtins.currentSystem }:
let let
pkgs = (import ./nixpkgs.nix { pkgs = (import ./nixpkgs.nix {
overlays = [
(final: pkg: {
pcre = (static pkg.pcre).overrideAttrs (x: {
configureFlags = x.configureFlags ++ [
"--enable-static"
];
});
})
];
config = { config = {
packageOverrides = pkg: { packageOverrides = pkg: {
autogen = (static pkg.autogen);
e2fsprogs = (static pkg.e2fsprogs);
gnupg = (static pkg.gnupg);
gpgme = (static pkg.gpgme); gpgme = (static pkg.gpgme);
libassuan = (static pkg.libassuan); libassuan = (static pkg.libassuan);
libgpgerror = (static pkg.libgpgerror); libgpgerror = (static pkg.libgpgerror);
libseccomp = (static pkg.libseccomp); libseccomp = (static pkg.libseccomp);
libuv = (static pkg.libuv);
glib = (static pkg.glib).overrideAttrs (x: { glib = (static pkg.glib).overrideAttrs (x: {
outputs = [ "bin" "out" "dev" ]; outputs = [ "bin" "out" "dev" ];
mesonFlags = [ mesonFlags = [
@ -23,6 +36,21 @@ let
-i "$dev"/include/glib-2.0/gobject/gobjectnotifyqueue.c -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"
];
});
}; };
}; };
}); });
@ -45,8 +73,8 @@ let
doCheck = false; doCheck = false;
enableParallelBuilding = true; enableParallelBuilding = true;
outputs = [ "out" ]; outputs = [ "out" ];
nativeBuildInputs = [ bash gitMinimal go-md2man installShellFiles makeWrapper pkg-config which ]; nativeBuildInputs = [ bash go-md2man installShellFiles makeWrapper pcre pkg-config which ];
buildInputs = [ glibc glibc.static gpgme libassuan libgpgerror libseccomp ]; buildInputs = [ glibc glibc.static glib gpgme libassuan libgpgerror libseccomp ];
prePatch = '' prePatch = ''
export CFLAGS='-static -pthread' export CFLAGS='-static -pthread'
export LDFLAGS='-s -w -static-libgcc -static' export LDFLAGS='-s -w -static-libgcc -static'

View File

@ -1,9 +1,9 @@
{ {
"url": "https://github.com/nixos/nixpkgs", "url": "https://github.com/nixos/nixpkgs",
"rev": "eb7e1ef185f6c990cda5f71fdc4fb02e76ab06d5", "rev": "eaba7870ffc3400eca4407baa24184b7fe337ec1",
"date": "2021-05-05T23:16:00+02:00", "date": "2021-06-02T10:22:59+02:00",
"path": "/nix/store/a98lkhjlsqh32ic2kkrv5kkik6jy25wh-nixpkgs", "path": "/nix/store/lcr7kwnx934b1z6wmb1zlqjycdlbaw9x-nixpkgs",
"sha256": "1ibz204c41g7baqga2iaj11yz9l75cfdylkiqjnk5igm81ivivxg", "sha256": "115disiz4b08iw46cidc7lm0advrxn5g2ldmlrxd53zf03skyb2w",
"fetchSubmodules": false, "fetchSubmodules": false,
"deepClone": false, "deepClone": false,
"leaveDotGit": false "leaveDotGit": false