user/gitlab-foss: fix APKBUILD

This commit is contained in:
build@apk-groulx 2023-01-11 17:30:28 +00:00
parent 02bebb22f7
commit f8643d1074
2 changed files with 100 additions and 41 deletions

View file

@ -63,6 +63,7 @@ install="$pkgname.pre-install $pkgname.post-install $pkgname.post-upgrade"
subpackages="$pkgname-assets::noarch"
source="https://gitlab.com/gitlab-org/gitlab-foss/-/archive/$_gittag/gitlab-foss-$_gittag.tar.gz
libgit-1.4-compat.patch
database-config.patch
$_pkgname.initd
$_pkgname.mailroom.initd
$_pkgname.rails.initd
@ -72,7 +73,7 @@ source="https://gitlab.com/gitlab-org/gitlab-foss/-/archive/$_gittag/gitlab-foss
$_pkgname.logrotate
bin-wrapper.in
"
builddir="$srcdir/gitlab-foss-$_gitrev"
builddir="$srcdir/gitlab-foss-$_gittag"
_prefix="usr/lib/bundles/$_pkgname"
@ -110,69 +111,69 @@ prepare() {
}
build() {
# local bundle_without='exclude development kerberos mysql test'
local bundle_without='exclude development kerberos mysql test'
# cd "$builddir"/workhorse
cd "$builddir"/workhorse
# make
make
# cd "$builddir"
cd "$builddir"
# msg "Installing Ruby gems..."
# bundle config --local without "$bundle_without"
# bundle config --local build.ffi --enable-system-libffi
# bundle config --local build.gpgme --use-system-libraries
# bundle config --local build.nokogiri --use-system-libraries \
# --with-xml2-include=/usr/include/libxml2 \
# --with-xslt-include=/usr/include/libxslt
# bundle config --local build.ruby-magic --enable-system-libraries
# bundle config --local build.rugged --use-system-libraries
# # https://github.com/protocolbuffers/protobuf/issues/2335#issuecomment-579913357
# bundle config --local build.google-protobuf --with-cflags=-D__va_copy=va_copy
msg "Installing Ruby gems..."
bundle config --local without "$bundle_without"
bundle config --local build.ffi --enable-system-libffi
bundle config --local build.gpgme --use-system-libraries
bundle config --local build.nokogiri --use-system-libraries \
--with-xml2-include=/usr/include/libxml2 \
--with-xslt-include=/usr/include/libxslt
bundle config --local build.ruby-magic --enable-system-libraries
bundle config --local build.rugged --use-system-libraries
# https://github.com/protocolbuffers/protobuf/issues/2335#issuecomment-579913357
bundle config --local build.google-protobuf --with-cflags=-D__va_copy=va_copy
# bundle install --no-cache
bundle install --no-cache
# Fix https://github.com/funny-falcon/murmurhash3-ruby/pull/9
# (
# cd vendor/bundle/ruby/*/extensions/*/*/murmurhash3-*
# mkdir -p murmurhash3
# mv native.so murmurhash3/
# )
(
cd vendor/bundle/ruby/*/extensions/*/*/murmurhash3-*
mkdir -p murmurhash3
mv native.so murmurhash3/
)
# Replace bundled CA bundle with symlink.
# (
# cd vendor/bundle/ruby/*/gems/aws-sdk-core-*/
# rm ca-bundle.crt
# ln -s /etc/ssl/certs/ca-certificates.crt ca-bundle.crt
# )
(
cd vendor/bundle/ruby/*/gems/aws-sdk-core-*/
rm ca-bundle.crt
ln -s /etc/ssl/certs/ca-certificates.crt ca-bundle.crt
)
# Remove faulty RPATH.
# chrpath -d vendor/bundle/ruby/*/extensions/*/*/ruby-magic-*/magic/magic.so
chrpath -d vendor/bundle/ruby/*/extensions/*/*/ruby-magic-*/magic/magic.so
# Patch installed gem gitlab-markup to use python3.
# Option "-S" causes that Python cannot find docutils module.
# sed -i 's/python2 -S/python3/g' \
# vendor/bundle/ruby/*/gems/gitlab-markup-*/lib/github/markups.rb
sed -i 's/python2 -S/python3/g' \
vendor/bundle/ruby/*/gems/gitlab-markup-*/lib/github/markups.rb
# Remove non-sense require of code for tests from top-level module
# (we're gonna delete tests from the package).
# sed -i '/require .carrierwave/test/matchers./d' \
# vendor/bundle/ruby/*/gems/carrierwave-*/lib/carrierwave.rb
sed -i '/require .carrierwave/test/matchers./d' \
vendor/bundle/ruby/*/gems/carrierwave-*/lib/carrierwave.rb
# msg "Installing npm modules..."
# yarn install --production --frozen-lockfile
msg "Installing npm modules..."
yarn install --production --frozen-lockfile
# Since we have moved assets gems into a group, they are not implicitly
# loaded by default. This will be reverted after compiling assets.
# sed -i.bak '/Bundler.require(\*Rails.groups/s/)/, :assets)/' \
# config/application.rb
sed -i.bak '/Bundler.require(\*Rails.groups/s/)/, :assets)/' \
config/application.rb
# assets:precompile and gettext:compile bootstraps the app,
# # so they needs configs.
# cp config/gitlab.yml.example config/gitlab.yml
# cp config/database.yml.postgresql config/database.yml
# cp config/secrets.yml.example config/secrets.yml
#
# so they needs configs.
cp config/gitlab.yml.example config/gitlab.yml
cp config/database.yml.postgresql config/database.yml
cp config/secrets.yml.example config/secrets.yml
# The configured path is not readable for the user building
# the package, so we must remove it; GitLab will use the default path.
sed -i '/^\s*secret_file:.*/d' config/gitlab.yml
@ -379,6 +380,7 @@ assets() {
sha512sums="
d976dda4677f143598a9b87f7dea929c83ba4adedace4252fc2f15cf5c7fbebff473074e6659b017ced78e9397590900d309f6c6411e9dbd58306196a91b01e1 gitlab-foss-v15.7.2.tar.gz
80e27697772c4529720f2ec65d314641cd5f437070d0fefd3c521852ff6dad8c9127534e379a5c0bcee4bbae8d5a373d131bf91a58606d02c89104e34a88baac libgit-1.4-compat.patch
dd984ae890c10119df6c510be1bd22e3d18652115ccaec6cb3e0a7c49d00cc72ec1c7c2414c29e6a13171c0a139626c8227e0ba3020f0ec3fe2c318b47101248 database-config.patch
55b0667d3969113ffd6860652ee8bdb9a534c25f413f33b2739e922c886988e7cea72c1c00c7eecf29fcff3682b1324156365605ffc6aae45d1e0ccddf96288b gitlab.initd
1f451b67a5d5e58650b0fe862a2b65cfb8bff5502b37d94ae90619c1ff9affbecf24428303a2849bebce5f94bef37078f0e5710e344bbab616134e910938384a gitlab.mailroom.initd
b6a6d9ba20557e61efa24f2d5a489873fefbb981f7d4465794a857b2971263c08ec29cc001c372522cdc0d48245e59751307c9f44f6ef4d87bf2e3ec5c23fb1c gitlab.rails.initd

View file

@ -0,0 +1,57 @@
diff --git a/config/database.yml.postgresql b/config/database.yml.postgresql
index 5329a8e..a4daab1 100644
--- a/config/database.yml.postgresql
+++ b/config/database.yml.postgresql
@@ -18,13 +18,6 @@ production:
# port: 8600
# record: secondary.postgresql.service.consul
# interval: 300
- geo:
- adapter: postgresql
- encoding: unicode
- database: gitlabhq_geo_production
- username: git
- password: "secure password"
- host: localhost
#
# Development specific
@@ -39,13 +32,6 @@ development:
host: localhost
variables:
statement_timeout: 15s
- geo:
- adapter: postgresql
- encoding: unicode
- database: gitlabhq_geo_development
- username: postgres
- password: "secure password"
- host: localhost
#
# Staging specific
@@ -58,13 +44,6 @@ staging:
username: git
password: "secure password"
host: localhost
- geo:
- adapter: postgresql
- encoding: unicode
- database: gitlabhq_geo_staging
- username: git
- password: "secure password"
- host: localhost
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
@@ -80,10 +59,3 @@ test: &test
prepared_statements: false
variables:
statement_timeout: 15s
- geo:
- adapter: postgresql
- encoding: unicode
- database: gitlabhq_geo_test
- username: postgres
- password:
- host: localhost