2020-06-18 07:06:33 +00:00
{ stdenv , lib , buildPackages , fetchurl , gettext
2020-04-24 23:36:52 +00:00
, genPosixLockObjOnly ? false
} : let
genPosixLockObjOnlyAttrs = lib . optionalAttrs genPosixLockObjOnly {
buildPhase = ''
cd src
make gen-posix-lock-obj
'' ;
installPhase = ''
mkdir - p $ out/bin
install - m755 gen-posix-lock-obj $ out/bin
'' ;
outputs = [ " o u t " ] ;
outputBin = " o u t " ;
} ;
in stdenv . mkDerivation ( rec {
pname = " l i b g p g - e r r o r " ;
2021-08-05 21:33:18 +00:00
version = " 1 . 4 2 " ;
2020-04-24 23:36:52 +00:00
src = fetchurl {
url = " m i r r o r : / / g n u p g / ${ pname } / ${ pname } - ${ version } . t a r . b z 2 " ;
2021-08-05 21:33:18 +00:00
sha256 = " s h a 2 5 6 - / A f n D 2 x h X 4 x P W Q q O N 6 m 4 3 S 4 s o e l A j 4 5 g R Z x n R S u S X i M = " ;
2020-04-24 23:36:52 +00:00
} ;
2021-08-22 07:53:02 +00:00
# 1.42 breaks (some?) cross-compilation (e.g. x86_64 -> aarch64).
# Backporting this fix (merged in upstream master but no release cut) by David Michael <fedora.dm0@gmail.com> https://dev.gnupg.org/rE33593864cd54143db594c4237bba41e14179061c
patches = [ ./fix-1.42-cross-compilation.patch ] ;
2021-08-18 13:19:15 +00:00
2020-04-24 23:36:52 +00:00
postPatch = ''
sed ' /BUILD_TIMESTAMP = /s / = . * / = 1 9 7 0 - 0 1 - 0 1 T00:01+0000/' - i ./configure
'' + l i b . o p t i o n a l S t r i n g ( s t d e n v . h o s t P l a t f o r m . i s A a r c h 3 2 & & s t d e n v . b u i l d P l a t f o r m ! = s t d e n v . h o s t P l a t f o r m ) ''
ln - s lock-obj-pub . arm-unknown-linux-gnueabi . h src/syscfg/lock-obj-pub.linux-gnueabihf.h
ln - s lock-obj-pub . arm-unknown-linux-gnueabi . h src/syscfg/lock-obj-pub.linux-gnueabi.h
'' + l i b . o p t i o n a l S t r i n g ( s t d e n v . h o s t P l a t f o r m . i s x 8 6 _ 6 4 & & s t d e n v . h o s t P l a t f o r m . i s M u s l ) ''
ln - s lock-obj-pub . x86_64-pc-linux-musl . h src/syscfg/lock-obj-pub.linux-musl.h
2021-09-28 08:13:01 +00:00
'' + l i b . o p t i o n a l S t r i n g ( s t d e n v . h o s t P l a t f o r m . i s i 6 8 6 & & s t d e n v . h o s t P l a t f o r m . i s M u s l ) ''
ln - s lock-obj-pub . i686-unknown-linux-gnu . h src/syscfg/lock-obj-pub.linux-musl.h
2020-04-24 23:36:52 +00:00
'' + l i b . o p t i o n a l S t r i n g ( s t d e n v . h o s t P l a t f o r m . i s A a r c h 3 2 & & s t d e n v . h o s t P l a t f o r m . i s M u s l ) ''
ln - s src/syscfg/lock-obj-pub.arm-unknown-linux-gnueabi.h src/syscfg/lock-obj-pub.arm-unknown-linux-musleabihf.h
ln - s src/syscfg/lock-obj-pub.arm-unknown-linux-gnueabi.h src/syscfg/lock-obj-pub.linux-musleabihf.h
'' ;
outputs = [ " o u t " " d e v " " i n f o " ] ;
outputBin = " d e v " ; # deps want just the lib, most likely
# If architecture-dependent MO files aren't available, they're generated
# during build, so we need gettext for cross-builds.
depsBuildBuild = [ buildPackages . stdenv . cc ] ;
nativeBuildInputs = [ gettext ] ;
postConfigure =
lib . optionalString stdenv . isSunOS
# For some reason, /bin/sh on OpenIndiana leads to this at the end of the
# `config.status' run:
# ./config.status[1401]: shift: (null): bad number
2020-05-15 21:57:56 +00:00
# (See <https://hydra.nixos.org/build/2931046/nixlog/1/raw>.)
2020-04-24 23:36:52 +00:00
# Thus, re-run it with Bash.
" ${ stdenv . shell } c o n f i g . s t a t u s " ;
doCheck = true ; # not cross
2021-02-05 17:12:51 +00:00
meta = with lib ; {
2021-02-19 19:06:45 +00:00
homepage = " h t t p s : / / w w w . g n u p g . o r g / s o f t w a r e / l i b g p g - e r r o r / i n d e x . h t m l " ;
changelog = " h t t p s : / / g i t . g n u p g . o r g / c g i - b i n / g i t w e b . c g i ? p = l i b g p g - e r r o r . g i t ; a = b l o b ; f = N E W S ; h b = r e f s / t a g s / l i b g p g - e r r o r - ${ version } " ;
2020-04-24 23:36:52 +00:00
description = " A s m a l l l i b r a r y t h a t d e f i n e s c o m m o n e r r o r v a l u e s f o r a l l G n u P G c o m p o n e n t s " ;
longDescription = ''
Libgpg-error is a small library that defines common error values
for all GnuPG components . Among these are GPG , GPGSM , GPGME ,
GPG-Agent , libgcrypt , Libksba , DirMngr , Pinentry , SmartCard
Daemon and possibly more in the future .
'' ;
license = licenses . lgpl2Plus ;
platforms = platforms . all ;
maintainers = [ maintainers . vrthra ] ;
} ;
} // genPosixLockObjOnlyAttrs )