Permalink
Browse files

Completely remove build-time git dependency

Previous build system required the git build tools to be installed to
operate properly. Worse: the test suite required git to be *built* to
operate at all.

We now completely remove that dependency by doing our own "build" or
rather, by removing the need to do a build at all. We simply assume
/usr/bin/perl exists, and that we'll use the GITPERLLIB environment to
specify the path to our Git library during testing.

do not depend on an externally built git and assume it is available
  • Loading branch information...
anarcat committed Nov 22, 2017
1 parent 02fe2f6 commit bfaa7d5e74d0426e4e7fd8f2b0107215574b8afb
Showing with 17 additions and 34 deletions.
  1. +3 −4 .travis.yml
  2. +6 −19 Makefile
  3. +4 −5 bin-wrapper/git
  4. +2 −0 git-mw.perl → git-mw
  5. +2 −0 git-remote-mediawiki.perl → git-remote-mediawiki
  6. +0 −6 t/test-gitmw-lib.sh
View
@@ -1,14 +1,13 @@
language: perl
env:
- GIT_ROOT_DIR="$TRAVIS_BUILD_DIR/git"
before_install:
- sudo apt-get update -q
- sudo apt-get install -y lighttpd php5 php5-cgi php5-cli php5-curl php5-sqlite git libmediawiki-api-perl liblwp-protocol-https-perl libdatetime-format-iso8601-perl
install:
- (cd t && ./install-wiki.sh install)
- git clone --depth=1 https://github.com/git/git "$TRAVIS_BUILD_DIR/git"
- ln -s /usr/bin/git "$TRAVIS_BUILD_DIR/git/git"
script:
- make test GIT_ROOT_DIR=$GIT_ROOT_DIR
- env GITPERLLIB="$TRAVIS_BUILD_DIR" make test
View
@@ -13,21 +13,17 @@
# make install
GIT_MEDIAWIKI_PM=Git/Mediawiki.pm
SCRIPT_PERL=git-remote-mediawiki.perl
SCRIPT_PERL+=git-mw.perl
export GIT_ROOT_DIR=../git
SCRIPT_PERL=git-remote-mediawiki
SCRIPT_PERL+=git-mw
INSTALL = install
SCRIPT_PERL_FULL=$(patsubst %,$(HERE)/%,$(SCRIPT_PERL))
INSTLIBDIR=$(shell $(MAKE) -C $(GIT_ROOT_DIR)/perl \
-s --no-print-directory instlibdir)
SCRIPT_PERL_FULL=$(patsubst %,$(shell pwd)/%,$(SCRIPT_PERL))
INSTLIBDIR=$(PREFIX)/share/perl5/
DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
INSTLIBDIR_SQ = $(subst ','\'',$(INSTLIBDIR))
all: build
test: all
test:
$(MAKE) -C t
check: perlcritic test
@@ -37,17 +33,8 @@ install_pm:
$(INSTALL) -m 644 $(GIT_MEDIAWIKI_PM) \
'$(DESTDIR_SQ)$(INSTLIBDIR_SQ)/$(GIT_MEDIAWIKI_PM)'
build:
$(MAKE) -C $(GIT_ROOT_DIR) SCRIPT_PERL="$(SCRIPT_PERL_FULL)" \
build-perl-script
install: install_pm
$(MAKE) -C $(GIT_ROOT_DIR) SCRIPT_PERL="$(SCRIPT_PERL_FULL)" \
install-perl-script
clean:
$(MAKE) -C $(GIT_ROOT_DIR) SCRIPT_PERL="$(SCRIPT_PERL_FULL)" \
clean-perl-script
$(INSTALL) $(SCRIPT_PERL) $(DESTDIR)$(PREFIX)/lib/git-core/
perlcritic:
perlcritic -5 $(SCRIPT_PERL)
View
@@ -3,12 +3,11 @@
# git executable wrapper script for Git-Mediawiki to run tests without
# installing all the scripts and perl packages.
GIT_ROOT_DIR=../../..
GIT_EXEC_PATH=$(cd "$(dirname "$0")" && cd ${GIT_ROOT_DIR} && pwd)
ROOT_DIR=$(dirname "$0")/..
GITPERLLIB="$GIT_EXEC_PATH"'/contrib/mw-to-git'"${GITPERLLIB:+:$GITPERLLIB}"
PATH="$GIT_EXEC_PATH"'/contrib/mw-to-git:'"$PATH"
GITPERLLIB="$ROOT_DIR${GITPERLLIB:+:$GITPERLLIB}"
PATH="$ROOT_DIR:$PATH"
export GITPERLLIB PATH
exec "${GIT_EXEC_PATH}/bin-wrappers/git" "$@"
exec "${GIT_EXEC_PATH:-/usr/bin/}git" "$@"
View
@@ -1,5 +1,7 @@
#!/usr/bin/perl
use lib (split(/:/, $ENV{GITPERLLIB}));
# Copyright (C) 2013
# Benoit Person <benoit.person@ensimag.imag.fr>
# Celestin Matte <celestin.matte@ensimag.imag.fr>
@@ -1,5 +1,7 @@
#! /usr/bin/perl
use lib (split(/:/, $ENV{GITPERLLIB}));
# Copyright (C) 2011
# Jérémie Nikaes <jeremie.nikaes@ensimag.imag.fr>
# Arnaud Lacurie <arnaud.lacurie@ensimag.imag.fr>
View
@@ -55,12 +55,6 @@ die_with_status () {
# Check the preconditions to run git-remote-mediawiki's tests
test_check_precond () {
if ! test_have_prereq PERL
then
skip_all='skipping gateway git-mw tests, perl not available'
test_done
fi
GIT_EXEC_PATH=$(cd "$(dirname "$0")" && cd "../.." && pwd)
PATH="$GIT_EXEC_PATH"'/bin-wrapper:'"$PATH"

0 comments on commit bfaa7d5

Please sign in to comment.