2020-05-30 14:29:33 +00:00
{ stdenv , lib , buildPackages , fetchurl , gettext
2018-03-22 22:18:07 +00:00
, genPosixLockObjOnly ? false
2018-02-25 01:51:04 +00:00
} : let
2018-03-22 22:18:07 +00:00
genPosixLockObjOnlyAttrs = lib . optionalAttrs genPosixLockObjOnly {
2018-02-25 01:51:04 +00:00
buildPhase = ''
cd src
make gen-posix-lock-obj
'' ;
installPhase = ''
mkdir - p $ out/bin
install - m755 gen-posix-lock-obj $ out/bin
'' ;
2005-12-19 10:34:01 +00:00
2018-02-25 01:51:04 +00:00
outputs = [ " o u t " ] ;
outputBin = " o u t " ;
} ;
in stdenv . mkDerivation ( rec {
2019-03-21 20:57:53 +00:00
pname = " l i b g p g - e r r o r " ;
2021-06-17 20:13:44 +00:00
version = " 1 . 4 2 " ;
2009-01-12 19:13:34 +00:00
2005-12-19 10:34:01 +00:00
src = fetchurl {
2019-03-21 20:57:53 +00:00
url = " m i r r o r : / / g n u p g / ${ pname } / ${ pname } - ${ version } . t a r . b z 2 " ;
2021-06-17 20:13:44 +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 = " ;
2005-12-19 10:34:01 +00:00
} ;
2009-01-12 19:13:34 +00:00
2021-07-27 08:07:06 +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 ] ;
2018-01-31 00:19:23 +00:00
postPatch = ''
sed ' /BUILD_TIMESTAMP = /s / = . * / = 1 9 7 0 - 0 1 - 0 1 T00:01+0000/' - i ./configure
2018-08-31 20:00:35 +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 . 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 ) ''
2018-07-14 18:43:43 +00:00
ln - s lock-obj-pub . arm-unknown-linux-gnueabi . h src/syscfg/lock-obj-pub.linux-gnueabihf.h
2019-12-28 05:56:39 +00:00
ln - s lock-obj-pub . arm-unknown-linux-gnueabi . h src/syscfg/lock-obj-pub.linux-gnueabi.h
2018-12-04 23:25:54 +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 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 ) ''
2018-01-31 00:19:23 +00:00
ln - s lock-obj-pub . x86_64-pc-linux-musl . h src/syscfg/lock-obj-pub.linux-musl.h
2021-09-27 16:09:43 +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
2018-12-04 23:25:54 +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
2018-01-31 00:19:23 +00:00
'' ;
2014-11-01 19:18:45 +00:00
2016-08-29 00:30:01 +00:00
outputs = [ " o u t " " d e v " " i n f o " ] ;
2015-10-11 19:59:52 +00:00
outputBin = " d e v " ; # deps want just the lib, most likely
2014-09-13 19:44:45 +00:00
# If architecture-dependent MO files aren't available, they're generated
2014-03-03 21:22:12 +00:00
# during build, so we need gettext for cross-builds.
2018-01-23 17:38:46 +00:00
depsBuildBuild = [ buildPackages . stdenv . cc ] ;
nativeBuildInputs = [ gettext ] ;
2014-03-03 21:22:12 +00:00
2014-11-01 19:18:45 +00:00
postConfigure =
2018-03-22 22:18:07 +00:00
lib . optionalString stdenv . isSunOS
2014-11-01 19:18:45 +00:00
# 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-04-18 20:51:19 +00:00
# (See <https://hydra.nixos.org/build/2931046/nixlog/1/raw>.)
2014-11-01 19:18:45 +00:00
# Thus, re-run it with Bash.
" ${ stdenv . shell } c o n f i g . s t a t u s " ;
2009-01-12 19:13:34 +00:00
2018-01-23 17:38:46 +00:00
doCheck = true ; # not cross
2014-04-08 23:15:38 +00:00
2021-01-21 17:00:13 +00:00
meta = with lib ; {
2021-01-11 21:58:23 +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 } " ;
2014-09-21 17:43:57 +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 " ;
2009-01-12 19:13:34 +00:00
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 .
'' ;
2015-10-11 19:59:52 +00:00
license = licenses . lgpl2Plus ;
platforms = platforms . all ;
2019-12-05 07:29:48 +00:00
maintainers = [ maintainers . vrthra ] ;
2011-11-01 22:38:05 +00:00
} ;
2018-02-25 01:51:04 +00:00
} // genPosixLockObjOnlyAttrs )