{"id":19509628,"url":"https://github.com/raspi/json2archpkgbuild","last_synced_at":"2026-05-17T07:36:17.829Z","repository":{"id":138159536,"uuid":"232875268","full_name":"raspi/Json2ArchPkgBuild","owner":"raspi","description":"Generate Arch Linux PKGBUILD files from JSON","archived":false,"fork":false,"pushed_at":"2020-01-10T03:53:30.000Z","size":66,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-22T21:05:27.554Z","etag":null,"topics":["arch-linux-pkgbuild","command-line-tool","json","packaging","release-automation"],"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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-01-09T18:17:26.000Z","updated_at":"2021-10-23T21:51:17.000Z","dependencies_parsed_at":"2024-06-19T12:44:33.726Z","dependency_job_id":null,"html_url":"https://github.com/raspi/Json2ArchPkgBuild","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/raspi/Json2ArchPkgBuild","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raspi%2FJson2ArchPkgBuild","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raspi%2FJson2ArchPkgBuild/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raspi%2FJson2ArchPkgBuild/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raspi%2FJson2ArchPkgBuild/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/raspi","download_url":"https://codeload.github.com/raspi/Json2ArchPkgBuild/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raspi%2FJson2ArchPkgBuild/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33130872,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-17T06:27:06.342Z","status":"ssl_error","status_checked_at":"2026-05-17T06:26:59.432Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","command-line-tool","json","packaging","release-automation"],"created_at":"2024-11-10T23:12:42.267Z","updated_at":"2026-05-17T07:36:17.790Z","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/Json2ArchPkgBuild/total?style=for-the-badge)\n![GitHub release (latest by date)](https://img.shields.io/github/v/release/raspi/Json2ArchPkgBuild?style=for-the-badge)\n![GitHub tag (latest by date)](https://img.shields.io/github/v/tag/raspi/Json2ArchPkgBuild?style=for-the-badge)\n\n# Json2ArchPkgBuild\nGenerate Arch Linux PKGBUILD files from JSON.\n\nUses https://github.com/raspi/go-PKGBUILD as library. See `man PKGBUILD`.\n\n```\njson2archpkgbuild - convert JSON to Arch Linux PKGBUILD - v0.0.4 (2020-01-10T05:09:05+02:00)\n(c) Pekka Järvinen 2020- - \u003cURL: https://github.com/raspi/Json2ArchPkgBuild \u003e\nParameters:\n  -build\n      build script file path (default: \"\")\n  -example\n      generate example JSON template (default: \"false\")\n  -incr\n      increase $pkgrel (default: \"false\")\n  -install\n      install script file path (default: \"\")\n  -json\n      output newly generated JSON to file (default: \"\")\n  -name\n      package name (default: \"\")\n  -now\n      use current time as reference $epoch (default: \"false\")\n  -prepare\n      prepare script file path (default: \"\")\n  -sums\n      Use checksum file as reference (default: \"\")\n  -t\n      Checksum file type (sha1, sha224, sha256, sha384, sha512, b2, md5) (default: \"sha256\")\n  -test\n      test script file path (default: \"\")\n  -ver\n      package version (default: \"\")\nExamples:\n  ./json2archpkgbuild \u003cfile.json\u003e\n  ./json2archpkgbuild -example\n  ./json2archpkgbuild -install install.sh app.json\n```\n## Why?\n\nSo you don't need to learn PKGBUILD file syntax. JSON is also easier to update with different tools.\n\n## Example\n\nSee [Makefile](Makefile) `ldistro-arch` and [release/linux/arch](release/linux/arch) for usage example.\n\nGenerate example JSON which you can use to for generating PKGBUILD package:\n\n    % json2archpkgbuild -example \u003e my-package.json\n    $EDITOR my-package.json \n\nGenerate PKGBUILD    \n\n    % json2archpkgbuild my-package.json \u003e PKGBUILD\n\nIncrease `$pkgrel` and get updated JSON file\n\n    % json2archpkgbuild -incr -json updated-package.json my-package.json \u003e PKGBUILD\n\nInject `install.sh` file to output\n\n    % json2archpkgbuild -install install.sh my-package.json \u003e PKGBUILD\n\nUse checksums as source files (`pkg_url_prefix` is used for prefixing the files)\n\n    % json2archpkgbuild -sums checksums.sha256 my-package.json \u003e PKGBUILD\n\n\n## Example JSON\n \n Use the `-example` parameter as this might be old.\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%2Fjson2archpkgbuild","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraspi%2Fjson2archpkgbuild","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraspi%2Fjson2archpkgbuild/lists"}