lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master a3ee7ce 2/7: Instal wxPdfDocument using Git i


From: Greg Chicares
Subject: [lmi-commits] [lmi] master a3ee7ce 2/7: Instal wxPdfDocument using Git instead of snapshot download
Date: Tue, 18 Sep 2018 13:29:30 -0400 (EDT)

branch: master
commit a3ee7ceeb83b1715a945c2f000601085220f2889
Author: Vadim Zeitlin <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Instal wxPdfDocument using Git instead of snapshot download
    
    This parallels the changes previously done to wxWidgets and the new
    install_wxpdfdoc.sh script is, in fact, an almost verbatim copy of
    install_wx.sh.
    
    Using Git makes it simpler and faster to switch to another revision of
    wxPdfDocument library.
---
 install_msw.sh        |   2 +-
 install_wxpdfdoc.make | 127 --------------------------------------------------
 install_wxpdfdoc.sh   | 122 ++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 123 insertions(+), 128 deletions(-)

diff --git a/install_msw.sh b/install_msw.sh
index 7ef211d..1f601d4 100755
--- a/install_msw.sh
+++ b/install_msw.sh
@@ -189,7 +189,7 @@ make $coefficiency --output-sync=recurse -f 
install_libxml2_libxslt.make
 
 ./install_wx.sh
 
-make $coefficiency --output-sync=recurse -f install_wxpdfdoc.make
+./install_wxpdfdoc.sh
 
 find /cache_for_lmi/downloads -type f | xargs md5sum
 
diff --git a/install_wxpdfdoc.make b/install_wxpdfdoc.make
deleted file mode 100644
index d0f18ae..0000000
--- a/install_wxpdfdoc.make
+++ /dev/null
@@ -1,127 +0,0 @@
-# Installer for wxPdfDocument library.
-#
-# Copyright (C) 2015, 2016, 2017, 2018 Gregory W. Chicares.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2 as
-# published by the Free Software Foundation.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
-#
-# http://savannah.nongnu.org/projects/lmi
-# email: <address@hidden>
-# snail: Chicares, 186 Belle Woods Drive, Glastonbury CT 06033, USA
-
-this_makefile := $(abspath $(lastword $(MAKEFILE_LIST)))
-
-# Configurable settings 
########################################################
-
-mingw_dir     := /MinGW_
-
-prefix        := /opt/lmi/local
-exec_prefix   := $(prefix)
-
-cache_dir     := /cache_for_lmi/downloads
-
-wxpdfdoc_dir  := /opt/lmi/wxpdfdoc-scratch
-
-# URLs and archive md5sums 
#####################################################
-
-# Unlike the other similar makefiles, we can't make the URL to end with the
-# archive name because we don't want to use the bare commit SHA-1 as the file
-# name, so we need a separate "urlbase" variable.
-
-wxpdfdoc_commit             := f66b42805a7262cdf07ab04a4e20b252b5d81ddb
-wxpdfdoc_archive            := wxpdfdoc-$(wxpdfdoc_commit).zip
-$(wxpdfdoc_archive)-urlbase := $(wxpdfdoc_commit).zip
-$(wxpdfdoc_archive)-root    := https://github.com/vadz/wxpdfdoc/archive
-$(wxpdfdoc_archive)-url     := 
$($(wxpdfdoc_archive)-root)/$($(wxpdfdoc_archive)-urlbase)
-$(wxpdfdoc_archive)-md5     := 150e34e93845de586d5c8ef3e4b4e6ff
-
-# Variables that normally should be left alone 
#################################
-
-mingw_bin_dir :=
-build_type    := x86_64-unknown-linux-gnu
-host_type     := i686-w64-mingw32
-
-uname := $(shell uname -s 2>/dev/null)
-ifeq (CYGWIN,$(findstring CYGWIN,$(uname)))
-  mingw_bin_dir := $(mingw_dir)/bin/
-  build_type    := i686-pc-cygwin
-  host_type     := i686-w64-mingw32
-endif
-
-compiler         := gcc-$(shell $(mingw_bin_dir)$(host_type)-gcc -dumpversion)
-
-wxpdfdoc_version := v0.9.6-28-gf66b428
-source_dir       := $(wxpdfdoc_dir)/wxPdfDoc-$(wxpdfdoc_version)
-
-wx_cc_flags      := -fno-omit-frame-pointer
-wx_cxx_flags     := -fno-omit-frame-pointer -std=c++11
-
-config_options = \
-  --prefix=$(prefix) \
-  --exec-prefix=$(exec_prefix) \
-  --with-wx-prefix=$(prefix) \
-  --with-wx-exec-prefix=$(exec_prefix) \
-  --build=$(build_type) \
-  --host=$(host_type) \
-  --disable-dependency-tracking \
-  CFLAGS='$(wx_cc_flags)' \
-  CXXFLAGS='$(wx_cxx_flags)' \
-
-# Utilities 
####################################################################
-
-ECHO   := echo
-MD5SUM := md5sum
-MKDIR  := mkdir
-RM     := rm
-UNZIP  := unzip
-WGET   := wget
-
-# Targets 
######################################################################
-
-.PHONY: all
-all: clobber_exec_prefix_only
-       $(MAKE) --file=$(this_makefile) wxpdfdoc
-
-.PHONY: initial_setup
-initial_setup:
-       $(MKDIR) --parents $(prefix)
-       $(MKDIR) --parents $(exec_prefix)
-       $(MKDIR) --parents $(cache_dir)
-       $(MKDIR) --parents $(wxpdfdoc_dir)
-
-UNZIPFLAGS := -q
-
-WGETFLAGS :=
-%.zip: WGETFLAGS += '--output-document=$@'
-
-.PHONY: %.zip
-%.zip: initial_setup
-       cd $(cache_dir) && [ -e $@ ] || $(WGET) $(WGETFLAGS) $(address@hidden)
-       cd $(cache_dir) && $(ECHO) "$(address@hidden) *$@" | $(MD5SUM) --check
-       -$(UNZIP) $(UNZIPFLAGS) $(cache_dir)/$@ -d $(wxpdfdoc_dir)
-       cp -a $(wxpdfdoc_dir)/$(basename $@) $(source_dir)
-
-.PHONY: wxpdfdoc
-wxpdfdoc: $(wxpdfdoc_archive)
-       cd $(source_dir) \
-         && export PATH="$(mingw_bin_dir):${PATH}" \
-         && autoreconf \
-         && ./configure $(config_options) \
-         && $(MAKE) install \
-
-.PHONY: clobber_exec_prefix_only
-clobber_exec_prefix_only:
-       -$(RM) --force --recursive $(exec_prefix)/lib/*wxcode*pdfdoc*
-       -$(RM) --force --recursive $(exec_prefix)/src/pdf*.inc
-       -$(RM) --force --recursive $(wxpdfdoc_dir)
-
diff --git a/install_wxpdfdoc.sh b/install_wxpdfdoc.sh
new file mode 100755
index 0000000..6c68643
--- /dev/null
+++ b/install_wxpdfdoc.sh
@@ -0,0 +1,122 @@
+#!/bin/sh
+
+# Installer for wxPdfDocument library.
+#
+# Copyright (C) 2015, 2016, 2017, 2018 Gregory W. Chicares.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+#
+# http://savannah.nongnu.org/projects/lmi
+# email: <address@hidden>
+# snail: Chicares, 186 Belle Woods Drive, Glastonbury CT 06033, USA
+
+set -vxe
+
+# A repository is cached in /cache_for_lmi/vcs/, where it can be kept
+# up to date and reused cheaply--whereas cloning it from a remote
+# host takes considerable time and bandwidth, and fails if internet
+# connectivity is lost, or the host is temporarily unavailable, or
+# it is blocked by a corporate firewall.
+
+# Configurable settings 
########################################################
+
+remote_host_url=${remote_host_url:-"https://github.com/vadz/wxpdfdoc.git"}
+
+wxpdfdoc_commit_sha=${wxpdfdoc_commit_sha:-"f66b42805a7262cdf07ab04a4e20b252b5d81ddb"}
+
+wxpdfdoc_skip_clean=${wxpdfdoc_skip_clean:-"0"}
+
+coefficiency=${coefficiency:-"--jobs=4"}
+
+MAKE=${MAKE:-"make $coefficiency"}
+
+# Variables that normally should be left alone 
#################################
+
+mingw_dir=/MinGW_
+
+prefix=/opt/lmi/local
+exec_prefix="$prefix"
+
+repo_name="wxpdfdoc"
+
+# Script commands 
##############################################################
+
+proxy_parent_dir="/cache_for_lmi/vcs"
+mkdir --parents "$proxy_parent_dir"
+
+proxy_wxpdfdoc_dir="$proxy_parent_dir"/$repo_name
+
+# Create a local mirror if it doesn't already exist.
+if [ ! -d "$proxy_wxpdfdoc_dir" ]
+then
+    cd "$proxy_parent_dir"
+    git clone "$coefficiency" "$remote_host_url" $repo_name
+fi
+
+cd "$proxy_wxpdfdoc_dir"
+
+# Fetch desired commit from remote host if missing.
+if ! git rev-parse --quiet --verify "$wxpdfdoc_commit_sha^{commit}" >/dev/null
+then
+    git fetch origin
+fi
+
+git checkout "$wxpdfdoc_commit_sha"
+
+build_type=$("$proxy_wxpdfdoc_dir"/admin/build-aux/config.guess)
+host_type=i686-w64-mingw32
+
+case $(uname) in
+    CYGWIN*)
+        mingw_bin_dir=$mingw_dir/bin/
+        ;;
+esac
+
+wxpdfdoc_cc_flags=-fno-omit-frame-pointer
+wxpdfdoc_cxx_flags=-fno-omit-frame-pointer
+
+config_options="
+  --prefix=$prefix
+  --exec-prefix=$exec_prefix
+  --with-wx-prefix=$prefix
+  --with-wx-exec-prefix=$exec_prefix
+  --build=$build_type
+  --host=$host_type
+  --disable-dependency-tracking
+  CFLAGS=$wxpdfdoc_cc_flags
+  CXXFLAGS=$wxpdfdoc_cxx_flags
+"
+
+[ -n "$mingw_bin_dir" ] && export PATH="$mingw_bin_dir:${PATH}"
+
+cd "$proxy_wxpdfdoc_dir"
+autoreconf --verbose
+
+build_dir="$prefix"/../wxpdfdoc-scratch/wxpdfdoc-$wxpdfdoc_commit_sha
+
+if [ "$wxpdfdoc_skip_clean" != 1 ]
+then
+    rm --force --recursive "$build_dir"
+    rm --force --recursive $exec_prefix/lib/*wxcode*pdfdoc*
+    rm --force --recursive $exec_prefix/src/pdf*.inc
+fi
+
+mkdir --parents "$build_dir"
+
+cd "$build_dir"
+"$proxy_wxpdfdoc_dir"/configure $config_options
+$MAKE
+$MAKE install
+
+exit 0



reply via email to

[Prev in Thread] Current Thread [Next in Thread]