summaryrefslogtreecommitdiffstats
path: root/src/netpbm.mk
blob: 4f138b5276bf64c8b78a99b72f6a8fb2c44735d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# This file is part of MXE.
# See index.html for further information.

PKG             := netpbm
$(PKG)_IGNORE   :=
$(PKG)_VERSION  := 10.35.91
$(PKG)_CHECKSUM := 23fa40c209060f64e52168c221d585ededa1b93c
$(PKG)_SUBDIR   := $(PKG)-$($(PKG)_VERSION)
$(PKG)_FILE     := $(PKG)-$($(PKG)_VERSION).tgz
$(PKG)_URL      := http://$(SOURCEFORGE_MIRROR)/project/netpbm/super_stable/$($(PKG)_VERSION)/$($(PKG)_FILE)
$(PKG)_DEPS     := gcc

define $(PKG)_UPDATE
    $(WGET) -q -O- 'http://sourceforge.net/projects/netpbm/files/super_stable/' | \
    $(SED) -n 's,.*netpbm-\([0-9][^>]*\)\.tgz.*,\1,p' | \
    head -1
endef

# The Netpbm package has its own weird build system...
# Parallel builds don't work, so we use -j1 explicitly.

define $(PKG)_BUILD
    # Create a suitable configuration
    cp '$(1)/Makefile.config.in' '$(1)/Makefile.config'
    echo 'DEFAULT_TARGET=nonmerge'          >> '$(1)/Makefile.config'
    echo 'CC=$(TARGET)-gcc'                 >> '$(1)/Makefile.config'
    echo 'LD=$(TARGET)-gcc'                 >> '$(1)/Makefile.config'
    echo 'LINKERISCOMPILER=Y'               >> '$(1)/Makefile.config'
    echo 'LINKER_CAN_DO_EXPLICIT_LIBRARY=Y' >> '$(1)/Makefile.config'
    echo 'AR=$(TARGET)-ar'                  >> '$(1)/Makefile.config'
    echo 'RANLIB=$(TARGET)-ranlib'          >> '$(1)/Makefile.config'
    echo 'OMIT_NETWORK=y'                   >> '$(1)/Makefile.config'
    echo 'DONT_HAVE_PROCESS_MGMT=Y'         >> '$(1)/Makefile.config'
    echo 'NETPBMLIBTYPE=unixstatic'         >> '$(1)/Makefile.config'
    echo 'NETPBMLIBSUFFIX=a'                >> '$(1)/Makefile.config'
    # Build only the library
    $(MAKE) -C '$(1)' -j1 PROG_SUBDIRS=
    # Package everything into a package directory. Use '-i' to ignore
    # failures that happen because we did not build all the tools.
    $(MAKE) -C '$(1)' -j1 -i package pkgdir='$(1)/mxe-pkgdir'
    # Install only the library from that package directory
    $(INSTALL) -d '$(PREFIX)/$(TARGET)/include'
    $(INSTALL) -m644 '$(1)/mxe-pkgdir/include/'* '$(PREFIX)/$(TARGET)/include'
    $(INSTALL) -d '$(PREFIX)/$(TARGET)/lib'
    $(INSTALL) -m644 '$(1)/mxe-pkgdir/link/libnetpbm.a' '$(PREFIX)/$(TARGET)/lib/'
endef