xref: /haiku/docs/develop/build/repositories/README.rst (revision e10dd8e99a9d7b730c79e6d59d1d288fc6c6dc9d)
1a5061eceSAdrien DestuguesHaikuPorts build-packages repository
2a5061eceSAdrien Destugues====================================
3a5061eceSAdrien Destugues
4a5061eceSAdrien DestuguesThe ``build/jam/repositories/HaikuPorts`` directory contains
5a5061eceSAdrien DestuguesRemotePackageRepository files which detail packages and repositories
6*e10dd8e9SNiels Sascha Reedijkleveraged during Haiku’s build process. While in the standard Haiku/HaikuPorts
7*e10dd8e9SNiels Sascha Reedijkpackage repositories, older package builds are purged at intervals, the build
8*e10dd8e9SNiels Sascha Reedijkpackage repositories have a stable set of packages required during the building
9*e10dd8e9SNiels Sascha Reedijkand running of Haiku. This makes sure that non-recent source trees can be
10*e10dd8e9SNiels Sascha Reedijkcontinued to build and run.
11a5061eceSAdrien Destugues
12a5061eceSAdrien Destugues   Warning: The URL packages are obtained from are determined by the
13*e10dd8e9SNiels Sascha Reedijk   sha256sum of the repository file. This means that when the
14*e10dd8e9SNiels Sascha Reedijk   `hardlink_packages.py` script is used to generate a new
15*e10dd8e9SNiels Sascha Reedijk   RemotePackageRepository jam file, it must not be modified in any way when
16*e10dd8e9SNiels Sascha Reedijk   committing it to the Haiku repository.
17*e10dd8e9SNiels Sascha Reedijk
18*e10dd8e9SNiels Sascha ReedijkPrerequisites
19*e10dd8e9SNiels Sascha Reedijk-------------
20*e10dd8e9SNiels Sascha Reedijk
21*e10dd8e9SNiels Sascha ReedijkThe actions require server access to Haiku's kubernetes environment by a Haiku
22*e10dd8e9SNiels Sascha Reedijksystem administrator. Please contact the Haiku system administrators when it is
23*e10dd8e9SNiels Sascha Reedijknecessary to create a new set of build packages.
24a5061eceSAdrien Destugues
25a5061eceSAdrien DestuguesUpdating
26a5061eceSAdrien Destugues--------
27a5061eceSAdrien Destugues
28a5061eceSAdrien DestuguesEach RemotePackageRepository jam file in this directory is processed by
29a5061eceSAdrien Destuguessrc/tools/hardlink_packages.py on the HaikuPorts package server.
30a5061eceSAdrien Destugues
31a5061eceSAdrien Destugues1) Latest RemotePackageRepository jam file in git is downloaded on
32a5061eceSAdrien Destugues   package server.
33a5061eceSAdrien Destugues2) Packages are added to HaikuPorts by automatic or manual means.
34a5061eceSAdrien Destugues3) hardlink_packages is provided all the relevant directories and
35a5061eceSAdrien Destugues   RemotePackageRepository file
36a5061eceSAdrien Destugues4) hardlink_packages performs additional modification of the
37a5061eceSAdrien Destugues   RemotePackageRepository and creates build repositories
38a5061eceSAdrien Destugues   (https://eu.hpkg.haiku-os.org/haikuports/master/build-packages/)
39a5061eceSAdrien Destugues5) The modified RemotePackageRepository file is copied back to the
40a5061eceSAdrien Destugues   developers system and checked in to git.
41a5061eceSAdrien Destugues
42a5061eceSAdrien DestuguesContainer Process
43a5061eceSAdrien Destugues-----------------
44a5061eceSAdrien Destugues
45a5061eceSAdrien DestuguesHere is the fastest way to update this as of today. Improvements are
46*e10dd8e9SNiels Sascha Reedijkneeded. Replace (BUILDMASTER) and (ARCH) with the architecture you are creating
47*e10dd8e9SNiels Sascha Reedijkthe build-packages packages for.
48*e10dd8e9SNiels Sascha Reedijk
49*e10dd8e9SNiels Sascha Reedijk(BUILDMASTER) is one of:
50*e10dd8e9SNiels Sascha Reedijk
51*e10dd8e9SNiels Sascha Reedijk* x86-64
52*e10dd8e9SNiels Sascha Reedijk* x86
53*e10dd8e9SNiels Sascha Reedijk
54*e10dd8e9SNiels Sascha Reedijk(ARCH) corresponds with the architectures. Note that where an ARCH like x86_64
55*e10dd8e9SNiels Sascha Reedijkmight use an underscore, the BUILDMASTER will use dashes.
56*e10dd8e9SNiels Sascha Reedijk
57a5061eceSAdrien Destugues
58a5061eceSAdrien DestuguesPrepare the build-packages repository
59a5061eceSAdrien Destugues-------------------------------------
60a5061eceSAdrien Destugues
61*e10dd8e9SNiels Sascha ReedijkRun the following steps from the shell.
62a5061eceSAdrien Destugues
63*e10dd8e9SNiels Sascha Reedijk#. Log into the remote haikuporter buildmaster for the target architecture.
64*e10dd8e9SNiels Sascha Reedijk
65*e10dd8e9SNiels Sascha Reedijk   .. code-block:: bash
66*e10dd8e9SNiels Sascha Reedijk
67*e10dd8e9SNiels Sascha Reedijk     kubectl exec -it deployment/haikuporter -c buildmaster-(BUILDMASTER) -- sh
68*e10dd8e9SNiels Sascha Reedijk
69*e10dd8e9SNiels Sascha Reedijk#. Get the current repository jam file for the platform that you want to update
70*e10dd8e9SNiels Sascha Reedijk
71*e10dd8e9SNiels Sascha Reedijk   .. code-block:: bash
72*e10dd8e9SNiels Sascha Reedijk
73*e10dd8e9SNiels Sascha Reedijk     wget https://git.haiku-os.org/haiku/plain/build/jam/repositories/HaikuPorts/(ARCH)
74*e10dd8e9SNiels Sascha Reedijk
75*e10dd8e9SNiels Sascha Reedijk#. If it is necessary to add or remove packages, then make changes to the
76*e10dd8e9SNiels Sascha Reedijk   downloaded package file.
77*e10dd8e9SNiels Sascha Reedijk#. Make sure that all the scripts and tools can find the libraries.
78*e10dd8e9SNiels Sascha Reedijk
79*e10dd8e9SNiels Sascha Reedijk   .. code-block:: bash
80*e10dd8e9SNiels Sascha Reedijk
81*e10dd8e9SNiels Sascha Reedijk     export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
82*e10dd8e9SNiels Sascha Reedijk
83*e10dd8e9SNiels Sascha Reedijk#. Run the `hardlink_packages.py` script to create a new build-packages
84*e10dd8e9SNiels Sascha Reedijk   repository and to update the package file.
85*e10dd8e9SNiels Sascha Reedijk
86*e10dd8e9SNiels Sascha Reedijk   .. code-block:: bash
87*e10dd8e9SNiels Sascha Reedijk
88*e10dd8e9SNiels Sascha Reedijk      /var/sources/haiku/src/tools/hardlink_packages.py \
89*e10dd8e9SNiels Sascha Reedijk          (ARCH) \
90*e10dd8e9SNiels Sascha Reedijk          /var/packages/repository/master/(ARCH)/current/packages/ \
91a5061eceSAdrien Destugues          /var/packages/build-packages/master/
92*e10dd8e9SNiels Sascha Reedijk
93*e10dd8e9SNiels Sascha Reedijk#. Exit the container and return to your local machine.
94*e10dd8e9SNiels Sascha Reedijk
95*e10dd8e9SNiels Sascha Reedijk   .. code-block:: bash
96*e10dd8e9SNiels Sascha Reedijk
97*e10dd8e9SNiels Sascha Reedijk      exit
98*e10dd8e9SNiels Sascha Reedijk
99a5061eceSAdrien Destugues
100a5061eceSAdrien DestuguesPull the repostory file and commit it
101a5061eceSAdrien Destugues-------------------------------------
102a5061eceSAdrien Destugues
103*e10dd8e9SNiels Sascha ReedijkWhen the build-packages repository is created, and the RemotePackageRepository
104*e10dd8e9SNiels Sascha Reedijkfile is updated, it can be pulled to the local machine and be committed to the
105*e10dd8e9SNiels Sascha ReedijkHaiku repository.
106a5061eceSAdrien Destugues
107*e10dd8e9SNiels Sascha ReedijkRun the following steps from the shell.
108*e10dd8e9SNiels Sascha Reedijk
109*e10dd8e9SNiels Sascha Reedijk#. Fetch the remote file generated in the previous stage and copy it to the
110*e10dd8e9SNiels Sascha Reedijk   local machine.
111*e10dd8e9SNiels Sascha Reedijk
112*e10dd8e9SNiels Sascha Reedijk   .. code-block:: bash
113*e10dd8e9SNiels Sascha Reedijk
114*e10dd8e9SNiels Sascha Reedijk     kubectl cp -c buildmaster-(BUILDMASTER) \
115*e10dd8e9SNiels Sascha Reedijk         $(kubectl get pods | grep haikuporter | awk ‘{ print $1 }’):./(ARCH) \
116*e10dd8e9SNiels Sascha Reedijk         (ARCH)
117*e10dd8e9SNiels Sascha Reedijk
118*e10dd8e9SNiels Sascha Reedijk#. Commit the updated repostory define *without modifying it* in any way.
119