Merge pull request #105026 from thefloweringash/apple-silicon
Native support for Apple Silicon
This commit is contained in:
@@ -30,9 +30,8 @@ stdenv.mkDerivation rec {
|
||||
|
||||
outputs = [ "out" "info" ];
|
||||
|
||||
buildInputs = [ ]
|
||||
++ lib.optional stdenv.isLinux acl
|
||||
++ lib.optional stdenv.isDarwin autoreconfHook;
|
||||
nativeBuildInputs = lib.optional stdenv.isDarwin autoreconfHook;
|
||||
buildInputs = lib.optional stdenv.isLinux acl;
|
||||
|
||||
# May have some issues with root compilation because the bootstrap tool
|
||||
# cannot be used as a login shell for now.
|
||||
|
||||
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
|
||||
};
|
||||
buildInputs = [ xz xar ];
|
||||
buildPhase = ''
|
||||
cc pbzx.c -llzma -lxar -o pbzx
|
||||
${stdenv.cc.targetPrefix}cc pbzx.c -llzma -lxar -o pbzx
|
||||
'';
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
From a14be07c0aae3bf6f732d1ca5f625ba375702121 Mon Sep 17 00:00:00 2001
|
||||
From: Andrew Childs <andrew.childs@bibo.com.ph>
|
||||
Date: Sun, 15 Nov 2020 19:12:33 +0900
|
||||
Subject: [PATCH 1/2] Add useless descriptions to AC_DEFINE
|
||||
|
||||
Removes autoheader warnings.
|
||||
---
|
||||
configure.ac | 42 +++++++++++++++++++++---------------------
|
||||
1 file changed, 21 insertions(+), 21 deletions(-)
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 812b5ff..358ab89 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -210,48 +210,48 @@ AC_CHECK_MEMBERS([struct stat.st_flags])
|
||||
|
||||
AC_CHECK_SIZEOF(uid_t)
|
||||
if test $ac_cv_sizeof_uid_t = "4"; then
|
||||
-AC_DEFINE(UID_STRING, RId32)
|
||||
-AC_DEFINE(UID_CAST, (uint32_t))
|
||||
+AC_DEFINE([UID_STRING], RId32, [UID_STRING])
|
||||
+AC_DEFINE([UID_CAST], (uint32_t), [UID_CAST])
|
||||
elif test $ac_cv_sizeof_uid_t = "8"; then
|
||||
-AC_DEFINE(UID_STRING, PRId64)
|
||||
-AC_DEFINE(UID_CAST, (uint64_t))
|
||||
+AC_DEFINE([UID_STRING], PRId64, [UID_STRING])
|
||||
+AC_DEFINE([UID_CAST], (uint64_t), [UID_CAST])
|
||||
else
|
||||
AC_ERROR(can not detect the size of your system's uid_t type)
|
||||
fi
|
||||
|
||||
AC_CHECK_SIZEOF(gid_t)
|
||||
if test $ac_cv_sizeof_gid_t = "4"; then
|
||||
-AC_DEFINE(GID_STRING, PRId32)
|
||||
-AC_DEFINE(GID_CAST, (uint32_t))
|
||||
+AC_DEFINE([GID_STRING], PRId32, [GID_STRING])
|
||||
+AC_DEFINE([GID_CAST], (uint32_t), [GID_CAST])
|
||||
elif test $ac_cv_sizeof_gid_t = "8"; then
|
||||
-AC_DEFINE(GID_STRING, PRId64)
|
||||
-AC_DEFINE(GID_CAST, (uint64_t))
|
||||
+AC_DEFINE([GID_STRING], PRId64, [GID_STRING])
|
||||
+AC_DEFINE([GID_CAST], (uint64_t), [GID_CAST])
|
||||
else
|
||||
AC_ERROR(can not detect the size of your system's gid_t type)
|
||||
fi
|
||||
|
||||
AC_CHECK_SIZEOF(ino_t)
|
||||
if test $ac_cv_sizeof_ino_t = "4"; then
|
||||
-AC_DEFINE(INO_STRING, PRId32)
|
||||
-AC_DEFINE(INO_HEXSTRING, PRIx32)
|
||||
-AC_DEFINE(INO_CAST, (uint32_t))
|
||||
+AC_DEFINE([INO_STRING], PRId32, [INO_STRING])
|
||||
+AC_DEFINE([INO_HEXSTRING], PRIx32, [INO_HEXSTRING])
|
||||
+AC_DEFINE([INO_CAST], (uint32_t), [INO_CAST])
|
||||
elif test $ac_cv_sizeof_ino_t = "8"; then
|
||||
-AC_DEFINE(INO_STRING, PRId64)
|
||||
-AC_DEFINE(INO_HEXSTRING, PRIx64)
|
||||
-AC_DEFINE(INO_CAST, (uint64_t))
|
||||
+AC_DEFINE([INO_STRING], PRId64, [INO_STRING])
|
||||
+AC_DEFINE([INO_HEXSTRING], PRIx64, [INO_HEXSTRING])
|
||||
+AC_DEFINE([INO_CAST], (uint64_t), [INO_CAST])
|
||||
else
|
||||
AC_ERROR(can not detect the size of your system's ino_t type)
|
||||
fi
|
||||
|
||||
AC_CHECK_SIZEOF(dev_t)
|
||||
if test $ac_cv_sizeof_dev_t = "4"; then
|
||||
-AC_DEFINE(DEV_STRING, PRId32)
|
||||
-AC_DEFINE(DEV_HEXSTRING, PRIx32)
|
||||
-AC_DEFINE(DEV_CAST, (uint32_t))
|
||||
+AC_DEFINE([DEV_STRING], PRId32, [DEV_STRING])
|
||||
+AC_DEFINE([DEV_HEXSTRING], PRIx32, [DEV_HEXSTRING])
|
||||
+AC_DEFINE([DEV_CAST], (uint32_t), [DEV_CAST])
|
||||
elif test $ac_cv_sizeof_dev_t = "8"; then
|
||||
-AC_DEFINE(DEV_STRING, PRId64)
|
||||
-AC_DEFINE(DEV_HEXSTRING, PRIx64)
|
||||
-AC_DEFINE(DEV_CAST, (uint64_t))
|
||||
+AC_DEFINE([DEV_STRING], PRId64, [DEV_STRING])
|
||||
+AC_DEFINE([DEV_HEXSTRING], PRIx64, [DEV_HEXSTRING])
|
||||
+AC_DEFINE([DEV_CAST], (uint64_t), [DEV_CAST])
|
||||
else
|
||||
AC_ERROR(can not detect the size of your system's dev_t type)
|
||||
fi
|
||||
@@ -261,7 +261,7 @@ AC_CHECK_LIB(acl, acl_get_file)
|
||||
dnl Check for paths
|
||||
AC_PREFIX_DEFAULT(/usr/local)
|
||||
|
||||
-AC_CHECK_FUNC([asprintf], AC_DEFINE([HAVE_ASPRINTF]))
|
||||
+AC_CHECK_FUNC([asprintf], AC_DEFINE([HAVE_ASPRINTF], [], [HAVE_ASPRINTF]))
|
||||
|
||||
dnl
|
||||
dnl Configure libxml2.
|
||||
--
|
||||
2.28.0
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
From 276833851657c85651c053ee16b8e1a8dc768a50 Mon Sep 17 00:00:00 2001
|
||||
From: Andrew Childs <andrew.childs@bibo.com.ph>
|
||||
Date: Sun, 15 Nov 2020 19:12:56 +0900
|
||||
Subject: [PATCH 2/2] Use pkg-config for libxml2
|
||||
|
||||
---
|
||||
configure.ac | 66 +++++++++-------------------------------------------
|
||||
1 file changed, 11 insertions(+), 55 deletions(-)
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 358ab89..984a694 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -268,61 +268,17 @@ dnl Configure libxml2.
|
||||
dnl
|
||||
LIBXML2_VERSION_MIN=2.6.11
|
||||
|
||||
-have_libxml2="1"
|
||||
-
|
||||
-AC_ARG_WITH([xml2-config], [ --with-xml2-config libxml2 config program],
|
||||
-if test "x${with_xml2_config}" = "xno" ; then
|
||||
- XML2_CONFIG=
|
||||
-else
|
||||
- XML2_CONFIG="${with_xml2_config}"
|
||||
-fi
|
||||
-,
|
||||
- XML2_CONFIG=
|
||||
-)
|
||||
-if test "x${XML2_CONFIG}" != "x" ; then
|
||||
- if test ! -x "${XML2_CONFIG}" ; then
|
||||
- AC_MSG_ERROR([Unusable or missing xml2-config: ${XML2_CONFIG}])
|
||||
- fi
|
||||
-else
|
||||
- AC_PATH_PROG([XML2_CONFIG], [xml2-config], , [${PATH}])
|
||||
- if test "x${XML2_CONFIG}" = "x" ; then
|
||||
- AC_MSG_ERROR([Cannot configure without xml2-config])
|
||||
- fi
|
||||
-fi
|
||||
-
|
||||
-dnl Make sure the version of libxml2 found is sufficient.
|
||||
-AC_MSG_CHECKING([for libxml >= ${LIBXML2_VERSION_MIN}])
|
||||
-LIBXML2_FOUND=`2>&1 ${XML2_CONFIG} --version`
|
||||
-LIBXML2_MAJOR=`echo ${LIBXML2_FOUND} | tr . " " | awk '{print $1}'`
|
||||
-LIBXML2_MINOR=`echo ${LIBXML2_FOUND} | tr . " " | awk '{print $2}' | tr a-z " " |awk '{print $1}'`
|
||||
-LIBXML2_BRANCH=`echo ${LIBXML2_FOUND} | tr . " " | awk '{print $3}' | tr a-z " " |awk '{print $1}'`
|
||||
-if test "x${LIBXML2_BRANCH}" = "x" ; then
|
||||
- LIBXML2_BRANCH=0
|
||||
-fi
|
||||
-LIBXML2_MAJOR_MIN=`echo ${LIBXML2_VERSION_MIN} | tr . " " | awk '{print $1}'`
|
||||
-LIBXML2_MINOR_MIN=`echo ${LIBXML2_VERSION_MIN} | tr . " " | awk '{print $2}'`
|
||||
-LIBXML2_BRANCH_MIN=`echo ${LIBXML2_VERSION_MIN} | tr . " " | awk '{print $3}'`
|
||||
-if test ${LIBXML2_MAJOR} -gt ${LIBXML2_MAJOR_MIN} \
|
||||
- -o ${LIBXML2_MAJOR} -eq ${LIBXML2_MAJOR_MIN} \
|
||||
- -a ${LIBXML2_MINOR} -gt ${LIBXML2_MINOR_MIN} \
|
||||
- -o ${LIBXML2_MAJOR} -eq ${LIBXML2_MAJOR_MIN} \
|
||||
- -a ${LIBXML2_MINOR} -eq ${LIBXML2_MINOR_MIN} \
|
||||
- -a ${LIBXML2_BRANCH} -ge $LIBXML2_BRANCH_MIN ; then
|
||||
- AC_MSG_RESULT([${LIBXML2_MAJOR}.${LIBXML2_MINOR}.${LIBXML2_BRANCH}])
|
||||
- have_libxml2="1"
|
||||
- CPPFLAGS="${CPPFLAGS} `${XML2_CONFIG} --cflags`"
|
||||
- LIBS="${LIBS} `${XML2_CONFIG} --libs`"
|
||||
-else
|
||||
- AC_MSG_RESULT([no])
|
||||
- have_libxml2="0"
|
||||
-fi
|
||||
-if test "x${have_libxml2}" = "x1" ; then
|
||||
- dnl Final sanity check, to make sure that xmlwriter is present.
|
||||
- AC_CHECK_HEADER([libxml/xmlwriter.h], , [have_libxml2="0"])
|
||||
-fi
|
||||
-if test "x${have_libxml2}" = "x0" ; then
|
||||
- AC_MSG_ERROR([Cannot build without libxml2])
|
||||
-fi
|
||||
+PKG_PROG_PKG_CONFIG
|
||||
+
|
||||
+PKG_CHECK_MODULES(LIBXML2_PKGCONFIG, [libxml-2.0 >= ${LIBXML2_VERSION_MIN}],
|
||||
+ [
|
||||
+ have_libxml2=1
|
||||
+ CPPFLAGS="${CPPFLAGS} ${LIBXML2_PKGCONFIG_CFLAGS}"
|
||||
+ LIBS="${LIBS} ${LIBXML2_PKGCONFIG_LIBS}"
|
||||
+ ],
|
||||
+ [
|
||||
+ have_libxml2=0
|
||||
+ ])
|
||||
|
||||
dnl
|
||||
dnl Configure libcrypto (part of OpenSSL).
|
||||
--
|
||||
2.28.0
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ lib, stdenv, fetchurl, libxml2, xz, openssl, zlib, bzip2, fts, autoconf }:
|
||||
{ lib, stdenv, fetchurl, pkg-config, libxml2, xz, openssl, zlib, bzip2, fts, autoreconfHook }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
version = "1.6.1";
|
||||
@@ -9,16 +9,20 @@ stdenv.mkDerivation rec {
|
||||
sha256 = "0ghmsbs6xwg1092v7pjcibmk5wkyifwxw6ygp08gfz25d2chhipf";
|
||||
};
|
||||
|
||||
buildInputs = [ libxml2 xz openssl zlib bzip2 fts autoconf ];
|
||||
nativeBuildInputs = [ autoreconfHook pkg-config ];
|
||||
buildInputs = [ libxml2 xz openssl zlib bzip2 fts ];
|
||||
|
||||
prePatch = ''
|
||||
patches = [
|
||||
./0001-Add-useless-descriptions-to-AC_DEFINE.patch
|
||||
./0002-Use-pkg-config-for-libxml2.patch
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace configure.ac \
|
||||
--replace 'OpenSSL_add_all_ciphers' 'OPENSSL_init_crypto' \
|
||||
--replace 'openssl/evp.h' 'openssl/crypto.h'
|
||||
'';
|
||||
|
||||
preConfigure = "./autogen.sh";
|
||||
|
||||
meta = {
|
||||
homepage = "https://mackyle.github.io/xar/";
|
||||
description = "Extensible Archiver";
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
, openssl
|
||||
, coreutils
|
||||
, autoreconfHook
|
||||
, autoSignDarwinBinariesHook
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
@@ -27,7 +28,12 @@ stdenv.mkDerivation rec {
|
||||
sha256 = "sha256-xt6txQWV8tmiLcbCmanyizk+NYNG6/bKREqEadwWbCc=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ pkg-config autoreconfHook unzip ];
|
||||
nativeBuildInputs = [ pkg-config autoreconfHook unzip ]
|
||||
# The preFixup hook rewrites the binary, which invaliates the code
|
||||
# signature. Add the fixup hook to sign the output.
|
||||
++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [
|
||||
autoSignDarwinBinariesHook
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
file
|
||||
|
||||
@@ -7,8 +7,15 @@
|
||||
, gnutlsSupport ? false, gnutls ? null
|
||||
, wolfsslSupport ? false, wolfssl ? null
|
||||
, scpSupport ? zlibSupport && !stdenv.isSunOS && !stdenv.isCygwin, libssh2 ? null
|
||||
, # a very sad story re static: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=439039
|
||||
gssSupport ? with stdenv.hostPlatform; !isWindows && !isStatic, libkrb5 ? null
|
||||
, gssSupport ? with stdenv.hostPlatform; !(
|
||||
!isWindows &&
|
||||
# a very sad story re static: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=439039
|
||||
!isStatic &&
|
||||
# the "mig" tool does not configure its compiler correctly. This could be
|
||||
# fixed in mig, but losing gss support on cross compilation to darwin is
|
||||
# not worth the effort.
|
||||
!(isDarwin && (stdenv.buildPlatform != stdenv.hostPlatform))
|
||||
), libkrb5 ? null
|
||||
, c-aresSupport ? false, c-ares ? null
|
||||
, brotliSupport ? false, brotli ? null
|
||||
}:
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
, pkg-config
|
||||
, pam
|
||||
, etcDir ? null
|
||||
, withKerberos ? true
|
||||
, withKerberos ? !(stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64)
|
||||
, libkrb5
|
||||
, libfido2
|
||||
, nixosTests
|
||||
|
||||
@@ -22,6 +22,10 @@ stdenv.mkDerivation rec {
|
||||
})
|
||||
];
|
||||
|
||||
preConfigure = lib.optionalString (lib.versionAtLeast stdenv.hostPlatform.darwinMinVersion "11") ''
|
||||
MACOSX_DEPLOYMENT_TARGET=10.16
|
||||
'';
|
||||
|
||||
configureFlags = lib.optional (!withPython) "--disable-python";
|
||||
|
||||
buildInputs = [ openssl libpcap ]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ lib, stdenv, fetchurl, perl
|
||||
{ lib, stdenv, fetchurl, fetchpatch, perl
|
||||
, ghostscript #for postscript and html output
|
||||
, psutils, netpbm #for html output
|
||||
, buildPackages
|
||||
@@ -22,6 +22,13 @@ stdenv.mkDerivation rec {
|
||||
|
||||
patches = [
|
||||
./0001-Fix-cross-compilation-by-looking-for-ar.patch
|
||||
]
|
||||
++ lib.optionals (stdenv.cc.isClang && lib.versionAtLeast stdenv.cc.version "9") [
|
||||
# https://trac.macports.org/ticket/59783
|
||||
(fetchpatch {
|
||||
url = "https://raw.githubusercontent.com/openembedded/openembedded-core/ce265cf467f1c3e5ba2edbfbef2170df1a727a52/meta/recipes-extended/groff/files/0001-Include-config.h.patch";
|
||||
sha256 = "1b0mg31xkpxkzlx696nr08rcc7ndpaxdplvysy0hw5099c4n1wyf";
|
||||
})
|
||||
];
|
||||
|
||||
postPatch = lib.optionalString (psutils != null) ''
|
||||
|
||||
Reference in New Issue
Block a user