Advertisement
andrejpodzimek

cardano-node PKGBUILD

Apr 5th, 2025
340
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 7.34 KB | Cryptocurrency | 0 0
  1. pkgname=cardano-node
  2. pkgver=10.2.1
  3. pkgrel=99
  4. pkgdesc='The core component that is used to participate in a Cardano decentralised blockchain.'
  5. license=('Apache')
  6. arch=('any')
  7. url='https://github.com/input-output-hk/cardano-node'
  8. _ghc_version='9.10.1'
  9. _cabal_version='3.12.1.0'
  10. makedepends=('git' 'ghcup-hs-bin')
  11. depends=('libsodium')
  12. backup=("etc/conf.d/cardano-node"
  13.         "var/lib/cardano-node/config/mainnet-config.json"
  14.         "var/lib/cardano-node/config/mainnet-topology.json"
  15.         "var/lib/cardano-node/config/mainnet-topology-p2p.json"
  16.         "var/lib/cardano-node/config/testnet-config.json"
  17.         "var/lib/cardano-node/config/testnet-topology.json"
  18.         "var/lib/cardano-node/config/testnet-topology-p2p.json")
  19. source=("https://github.com/input-output-hk/${pkgname}/archive/${pkgver}.zip"
  20.         'mainnet-config.json::https://book.world.dev.cardano.org/environments/mainnet/config.json'
  21.         'mainnet-byron-genesis.json::https://book.world.dev.cardano.org/environments/mainnet/byron-genesis.json'
  22.         'mainnet-shelley-genesis.json::https://book.world.dev.cardano.org/environments/mainnet/shelley-genesis.json'
  23.         'mainnet-alonzo-genesis.json::https://book.world.dev.cardano.org/environments/mainnet/alonzo-genesis.json'
  24.         'mainnet-conway-genesis.json::https://book.world.dev.cardano.org/environments/mainnet/conway-genesis.json'
  25.         'mainnet-topology.json::https://book.world.dev.cardano.org/environments/mainnet/topology.json'
  26.         'mainnet-topology-p2p.json::https://book.world.dev.cardano.org/environments/mainnet/topology-p2p.json'
  27.         'testnet-config.json::https://book.world.dev.cardano.org/environments/preprod/config.json'
  28.         'testnet-byron-genesis.json::https://book.world.dev.cardano.org/environments/preprod/byron-genesis.json'
  29.         'testnet-shelley-genesis.json::https://book.world.dev.cardano.org/environments/preprod/shelley-genesis.json'
  30.         'testnet-alonzo-genesis.json::https://book.world.dev.cardano.org/environments/preprod/alonzo-genesis.json'
  31.         'testnet-conway-genesis.json::https://book.world.dev.cardano.org/environments/preprod/conway-genesis.json'
  32.         'testnet-topology.json::https://book.world.dev.cardano.org/environments/preprod/topology.json'
  33.         ### 'testnet-topology-p2p.json::https://book.world.dev.cardano.org/environments/preprod/topology-p2p.json'
  34.         "cardano-node.sysusers"
  35.         "cardano-node.tmpfiles"
  36.         "cardano-node.service"
  37.         "cardano-node.confd"
  38.         "cardano-node-testnet.service"
  39.         "cardano-node-testnet.confd")
  40. sha256sums=('3c290dbc61c96412a951c307405e2428e93c06f332766bbbac94d59d2dfd43c5'
  41.             '997bdea73d599d0ea5b72205de6fad391adeadb3beef34145cddc990a16e61b7'
  42.             '4f28b3b437b2c4f6ee26cc70964b3a5f1a274b0b3909c31535091c00316c13aa'
  43.             '59cd3932c6dd792bc5020ca3336064a8faabde4e4a8dc7d143ff4df6eec36961'
  44.             '7333bfafe311589fa09e8bf59a47ec0d85a1959f00748cc0800591d2c7646408'
  45.             '0e70fc5317732e178aa2a3c6579e5123573d25525ee11af1261f3c4151fffddb'
  46.             '6fb9ee83834603b0c2d0b679e0322ebe04208490dfcf402e3aa6df51bab30a9b'
  47.             '6fb9ee83834603b0c2d0b679e0322ebe04208490dfcf402e3aa6df51bab30a9b'
  48.             'c25b85b8b86101c6ca8364e8d8aa6206cf51b2517b6152b9eac6fef247e2bf51'
  49.             'd88fbffdf78daaccfaddf504e95840c73ce527c06fa4140aefb55d3f91c00cef'
  50.             '4b9d32c09159c2948e4386ba1f59db5a249a89b43b84dfd8368f465e650095de'
  51.             '7333bfafe311589fa09e8bf59a47ec0d85a1959f00748cc0800591d2c7646408'
  52.             'c196814fe2e8f36ad1910e5c287184970339657729e7ad4fc354c34e149be3f8'
  53.             '45488c0879b1e8ac0fc10ec3ee93db103be7e3476f943495067df6970a03c02c'
  54.             '703f9b033c299b652b2d3228ee6ef4a9c09b7e846ff4b366a2aca68960370234'
  55.             '3212902b0d2bb0e6bacba0feeafd261516b9f6ab5f37f876a8c37239a1947542'
  56.             'a712b09a9e9594dad7c8cb2cbb4a4eaa691fb0c3ba8491edfb5d0a56dfaf2c29'
  57.             '809f5b67dd8ec0216655347361935d7d6a23299a31ff795f6c5ec806501bc5fd'
  58.             'd5badb9167fddcb4abdad451f7f2a8ee2eb00d7e1631b85778ba2ae783c263c2'
  59.             '07a3dde7fb51f3f84bb51e7c15993dfefa337571ed509cc3588e73c54f606282')
  60.  
  61. prepare() {
  62.   cd "${srcdir}/${pkgname}-${pkgver}"
  63.   # NOTE: this is used to avoid running out of space when
  64.   # /tmp is not large enough
  65.   mkdir -p ${srcdir}/ghcup_tmp
  66.   TMPDIR=${srcdir}/ghcup_tmp ghcup install ghc ${_ghc_version}
  67.   TMPDIR=${srcdir}/ghcup_tmp ghcup install cabal ${_cabal_version}
  68.   ghcup set ghc ${_ghc_version}
  69.   ghcup set cabal ${_cabal_version}
  70.   export PATH="$HOME/.cabal/bin:$HOME/.ghcup/bin:$PATH"
  71.   export PKG_CONFIG_PATH='/usr/lib/pkgconfig'
  72.   cabal configure --with-compiler=ghc-${_ghc_version}
  73.   echo 'package cardano-crypto-praos' >> ${srcdir}/${pkgname}-${pkgver}/cabal.project.local
  74.   echo '  flags: -external-libsodium-vrf' >> ${srcdir}/${pkgname}-${pkgver}/cabal.project.local
  75.   cabal update
  76. }
  77.  
  78. build() {
  79.   cd "${srcdir}/${pkgname}-${pkgver}"
  80.   cabal build all
  81.   cabal build cardano-cli
  82. }
  83.  
  84. package() {
  85.   install -D -m0644 "${srcdir}/${pkgname}.sysusers" "${pkgdir}/usr/lib/sysusers.d/${pkgname}.conf"
  86.   install -D -m0644 "${srcdir}/${pkgname}.tmpfiles" "${pkgdir}/usr/lib/tmpfiles.d/${pkgname}.conf"
  87.   install -D -m0644 "${srcdir}/${pkgname}.service" "${pkgdir}/usr/lib/systemd/system/${pkgname}.service"
  88.   install -D -m0644 "${srcdir}/${pkgname}.confd" "${pkgdir}/etc/conf.d/${pkgname}"
  89.  
  90.   install -D -m0644 "mainnet-config.json" "${pkgdir}/var/lib/${pkgname}/config/mainnet-config.json"
  91.   install -D -m0644 "mainnet-byron-genesis.json" "${pkgdir}/var/lib/${pkgname}/config/mainnet-byron-genesis.json"
  92.   install -D -m0644 "mainnet-shelley-genesis.json" "${pkgdir}/var/lib/${pkgname}/config/mainnet-shelley-genesis.json"
  93.   install -D -m0644 "mainnet-alonzo-genesis.json" "${pkgdir}/var/lib/${pkgname}/config/mainnet-alonzo-genesis.json"
  94.   install -D -m0644 "mainnet-conway-genesis.json" "${pkgdir}/var/lib/${pkgname}/config/mainnet-conway-genesis.json"
  95.   install -D -m0644 "mainnet-topology.json" "${pkgdir}/var/lib/${pkgname}/config/mainnet-topology.json"
  96.   install -D -m0644 "mainnet-topology-p2p.json" "${pkgdir}/var/lib/${pkgname}/config/mainnet-topology-p2p.json"
  97.   install -D -m0644 "testnet-config.json" "${pkgdir}/var/lib/${pkgname}/config/testnet-config.json"
  98.   install -D -m0644 "testnet-byron-genesis.json" "${pkgdir}/var/lib/${pkgname}/config/testnet-byron-genesis.json"
  99.   install -D -m0644 "testnet-shelley-genesis.json" "${pkgdir}/var/lib/${pkgname}/config/testnet-shelley-genesis.json"
  100.   install -D -m0644 "testnet-alonzo-genesis.json" "${pkgdir}/var/lib/${pkgname}/config/testnet-alonzo-genesis.json"
  101.   install -D -m0644 "testnet-conway-genesis.json" "${pkgdir}/var/lib/${pkgname}/config/testnet-conway-genesis.json"
  102.   install -D -m0644 "testnet-topology.json" "${pkgdir}/var/lib/${pkgname}/config/testnet-topology.json"
  103.   ### install -D -m0644 "testnet-topology-p2p.json" "${pkgdir}/var/lib/${pkgname}/config/testnet-topology-p2p.json"
  104.  
  105.   install -D -m0644 "${srcdir}/${pkgname}-testnet.service" "${pkgdir}/usr/share/${pkgname}/${pkgname}-testnet-example.service"
  106.   install -D -m0644 "${srcdir}/${pkgname}-testnet.confd" "${pkgdir}/usr/share/${pkgname}/${pkgname}-testnet-example.confd"
  107.  
  108.   cd "${srcdir}/${pkgname}-${pkgver}"
  109.   install -D -m0755 "$(./scripts/bin-path.sh cardano-cli)" "${pkgdir}/usr/bin/cardano-cli"
  110.   install -D -m0755 "$(./scripts/bin-path.sh cardano-node)" "${pkgdir}/usr/bin/cardano-node"
  111. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement