{"id":19509562,"url":"https://github.com/raspi/go-pkgbuild","last_synced_at":"2026-06-10T22:31:18.298Z","repository":{"id":57506387,"uuid":"232878359","full_name":"raspi/go-PKGBUILD","owner":"raspi","description":"Template for Arch Linux PKGBUILD file","archived":false,"fork":false,"pushed_at":"2020-08-03T23:59:55.000Z","size":56,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-08T11:42:10.134Z","etag":null,"topics":["arch-linux-pkgbuild","go","golang-library","packaging","release-automation","template"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/raspi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-01-09T18:35:04.000Z","updated_at":"2020-11-30T14:33:53.000Z","dependencies_parsed_at":"2022-08-29T20:01:04.905Z","dependency_job_id":null,"html_url":"https://github.com/raspi/go-PKGBUILD","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raspi%2Fgo-PKGBUILD","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raspi%2Fgo-PKGBUILD/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raspi%2Fgo-PKGBUILD/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raspi%2Fgo-PKGBUILD/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/raspi","download_url":"https://codeload.github.com/raspi/go-PKGBUILD/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240761105,"owners_count":19853255,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arch-linux-pkgbuild","go","golang-library","packaging","release-automation","template"],"created_at":"2024-11-10T23:12:28.941Z","updated_at":"2026-06-10T22:31:18.284Z","avatar_url":"https://github.com/raspi.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"![GitHub All Releases](https://img.shields.io/github/downloads/raspi/go-PKGBUILD/total?style=for-the-badge)\n![GitHub release (latest by date)](https://img.shields.io/github/v/release/raspi/go-PKGBUILD?style=for-the-badge)\n![GitHub tag (latest by date)](https://img.shields.io/github/v/tag/raspi/go-PKGBUILD?style=for-the-badge)\n\n# go-PKGBUILD library\n\nGenerate Arch Linux PKGBUILD string from template struct. See `man PKGBUILD`.\n\n## Install\n\n    go get -u github.com/raspi/go-PKGBUILD\n\n## Projects using this library\n\n* [Json2ArchPkgBuild](https://github.com/raspi/Json2ArchPkgBuild) - This library as CLI application\n* [heksa](https://github.com/raspi/heksa) - Cross-platform command line hex dumper\n* Yours?\n  * Send pull request or open new issue\n \n ## Notes\n \n * Use empty string (`\"\"`) as CPU architecture when referencing source files and checksums without CPU architecture\n  \n ## Example template as JSON\n \n ```json\n {\n  \"_meta\": {\n    \"ver\": \"v1.0.0\"\n  },\n  \"maintainer\": \"John Doe\",\n  \"maintainer_email\": \"jd@example.org\",\n  \"name\": [\n    \"exampleapp\"\n  ],\n  \"version\": \"v1.0.0\",\n  \"release\": 1,\n  \"release_time\": \"1970-01-01T02:00:00+02:00\",\n  \"short_description\": \"my example application\",\n  \"licenses\": [\n    \"Apache 2.0\"\n  ],\n  \"url\": \"https://github.com/examplerepo/exampleapp\",\n  \"changelog_file\": \"\",\n  \"groups\": null,\n  \"dependencies\": {\n    \"\": {\n      \"packages\": [\n        \"example-core\"\n      ],\n      \"build_packages\": [\n        \"example-dev\"\n      ],\n      \"test_packages\": [\n        \"example-test\"\n      ]\n    },\n    \"x86_64\": {\n      \"packages\": [\n        \"example-core-x86\"\n      ]\n    }\n  },\n  \"optional_packages\": {\n    \"\": [\n      {\n        \"package\": \"php\",\n        \"reason\": \"because PHP is EPIC!\"\n      }\n    ]\n  },\n  \"provides\": null,\n  \"options\": [\n    \"!strip\",\n    \"docs\",\n    \"libtool\",\n    \"staticlibs\",\n    \"emptydirs\",\n    \"!zipman\",\n    \"!ccache\",\n    \"!distcc\",\n    \"!buildflags\",\n    \"makeflags\",\n    \"!debug\"\n  ],\n  \"install\": \"$pkgname.install\",\n  \"files\": {\n    \"aarch64\": [\n      {\n        \"url\": \"https://github.com/examplerepo/exampleapp/releases/download/$pkgver/$pkgname-$pkgver-linux-arm64.tar.gz\",\n        \"checksums\": {\n          \"sha256\": \"11d2b36d6b320dfee489d475635b53206b59288537554ea8bc24f97d06139d64\"\n        }\n      }\n    ],\n    \"arm\": [\n      {\n        \"url\": \"https://github.com/examplerepo/exampleapp/releases/download/$pkgver/$pkgname-$pkgver-linux-arm.tar.gz\",\n        \"checksums\": {\n          \"sha256\": \"5e79210655a9a71a7b77a3168194e9ead024a120182fa8560348a24dc87da159\"\n        }\n      }\n    ],\n    \"ppc64\": [\n      {\n        \"url\": \"https://github.com/examplerepo/exampleapp/releases/download/$pkgver/$pkgname-$pkgver-linux-ppc64.tar.gz\",\n        \"checksums\": {\n          \"sha256\": \"f744e32caf67a609aa435df9f8c519460b1856f7968c057e6ba61397cf79ec15\"\n        }\n      }\n    ],\n    \"ppc64le\": [\n      {\n        \"url\": \"https://github.com/examplerepo/exampleapp/releases/download/$pkgver/$pkgname-$pkgver-linux-ppc64le.tar.gz\",\n        \"checksums\": {\n          \"sha256\": \"6baef7ee046ceb4450e703a87f05fa5662708d4c3562c26abb427d34b4c82819\"\n        }\n      }\n    ],\n    \"x86_64\": [\n      {\n        \"url\": \"https://github.com/examplerepo/exampleapp/releases/download/$pkgver/$pkgname-$pkgver-linux-amd64.tar.gz\",\n        \"checksums\": {\n          \"sha256\": \"de3edfb94d5d0ae3d027c6c743e27290fa0500da4777da57154f2acab52775bf\"\n        }\n      }\n    ]\n  },\n  \"commands\": {\n    \"prepare\": [\n      \"echo foo \\u003e\\u003e main.c\"\n    ],\n    \"build\": [\n      \"make\"\n    ],\n    \"test\": [\n      \"make test\"\n    ],\n    \"install\": [\n      \"cd \\\"$srcdir\\\"\",\n      \"install -Dm644 \\\"LICENSE\\\" -t \\\"$pkgdir/usr/share/licenses/$pkgname\\\"\",\n      \"install -Dm644 \\\"README.md\\\" -t \\\"$pkgdir/usr/share/doc/$pkgname\\\"\",\n      \"install -Dm755 \\\"bin/$pkgname\\\" -t \\\"$pkgdir/usr/bin\\\"\"\n    ]\n  }\n}\n ```\n \n## Example PKGBUILD output:\n \n ```bash\n# Maintainer: John Doe \u003cjd@example.org\u003e\n# Generated at: 2020-01-10 00:42:46.792588521 +0200 EET m=+0.000536267 \n\npkgname=exampleapp\npkgver=v1.0.0\npkgrel=1\npkgdesc=\"my example application\"\nurl=\"https://github.com/examplerepo/exampleapp\"\nlicense=('Apache 2.0')\narch=('aarch64' 'arm' 'ppc64' 'ppc64le' 'x86_64')\ninstall=$pkgname.install\ndepends_x86_64=('example-core-x86')\n\ndepends=('example-core')\n\nmakedepends=('example-dev')\n\ncheckdepends=('example-test')\noptdepends=('php: because PHP is EPIC!')\nsha256sums_aarch64=('11d2b36d6b320dfee489d475635b53206b59288537554ea8bc24f97d06139d64')\nsha256sums_arm=('5e79210655a9a71a7b77a3168194e9ead024a120182fa8560348a24dc87da159')\nsha256sums_ppc64=('f744e32caf67a609aa435df9f8c519460b1856f7968c057e6ba61397cf79ec15')\nsha256sums_ppc64le=('6baef7ee046ceb4450e703a87f05fa5662708d4c3562c26abb427d34b4c82819')\nsha256sums_x86_64=('de3edfb94d5d0ae3d027c6c743e27290fa0500da4777da57154f2acab52775bf')\nsource_aarch64=(\"https://github.com/examplerepo/exampleapp/releases/download/$pkgver/$pkgname-$pkgver-linux-arm64.tar.gz\")\nsource_arm=(\"https://github.com/examplerepo/exampleapp/releases/download/$pkgver/$pkgname-$pkgver-linux-arm.tar.gz\")\nsource_ppc64=(\"https://github.com/examplerepo/exampleapp/releases/download/$pkgver/$pkgname-$pkgver-linux-ppc64.tar.gz\")\nsource_ppc64le=(\"https://github.com/examplerepo/exampleapp/releases/download/$pkgver/$pkgname-$pkgver-linux-ppc64le.tar.gz\")\nsource_x86_64=(\"https://github.com/examplerepo/exampleapp/releases/download/$pkgver/$pkgname-$pkgver-linux-amd64.tar.gz\")\n\nprepare() {\n  echo foo \u003e\u003e main.c\n}\n\nbuild() {\n  make\n}\n\ncheck() {\n  make test\n}\n\npackage() {\n  cd \"$srcdir\"\n  install -Dm644 \"LICENSE\" -t \"$pkgdir/usr/share/licenses/$pkgname\"\n  install -Dm644 \"README.md\" -t \"$pkgdir/usr/share/doc/$pkgname\"\n  install -Dm755 \"bin/$pkgname\" -t \"$pkgdir/usr/bin\"\n}\n ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraspi%2Fgo-pkgbuild","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraspi%2Fgo-pkgbuild","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraspi%2Fgo-pkgbuild/lists"}