aboutsummaryrefslogtreecommitdiff
path: root/deprecated/iraf-src/iraf.ini
blob: 7a14ccb8584324ce99b3a978ff2da3ccdf653492 (plain) (blame)
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
[package]
name: iraf
version: 2.16.1

[about]
home: http://iraf.noao.edu
license: MIT
summary: NOAO Image Reduction and Analysis Facility

[source]
# Remember, always 32-bit! Now feast upon my tears.
#fn: ${package:name}.lnux.x86.fixup.tar.gz
#url: ${cbc_cgi:url}/${fn}
git_url: ssh://git@bitbucket.org/jhunkeler/${package:name}-src

# Tarball should be generated with:
# git archive --format tar.gz --prefix iraf/ -o ../iraf.lnux.x86.fixup.tar.gz -v master

[build]
number: 1
#detect_binary_files_with_prefix: True

[requirements]
build:
    # Luck
run:
    # Gallant effort

[cbc_build]
linux:
    export TERM=xterm
    export iraf=$$PREFIX/iraf/
    export IRAFARCH=macosx

    cp -a `pwd` $$PREFIX/iraf
    cd $$PREFIX/iraf

    export FAKEHOME=$$PREFIX/iraf/fakehome
    mkdir -p $$FAKEHOME
    
    ./install \
        --accept-defaults \
        --fakehome $$FAKEHOME \
        --term xterm \
        --mach $$IRAFARCH \
        --bindir $$FAKEHOME/bin \
        --cache $$FAKEHOME/cache \
        --imdir $$FAKEHOME/imdir \
        --no-errors

	sed -i -e "s|exit|return|g" unix/hlib/irafuser.*
	source unix/hlib/irafuser.sh
	# Fix me? why did i unset it?
    export FAKEHOME=$$PREFIX/iraf/fakehome
	
    mkdir -p bin.generic
	mkdir -p bin.$$IRAFARCH

    find . -lname '/iraf/iraf/*' \
        -exec sh -c 'ln -snf \
        "$$(readlink "$$0" \
        | sed -e "s|/iraf/iraf|../..|" -e "s|/as/|/as.$$IRAFARCH/|")" "$$0"' {} \;

    find "$$iraf" -type f \
        \( -name "*.c" \
        -o -name "*.f" \
        -o -name "*.h" \
        -o -name "*.x" \
        -o -name "*.sh*" \
        -o -name "*.csh*" \
        -o -name "*akefile*" \
        -o -name "*mkpkg*" \
        -o -name "*mklibs*" \
        -o -name "*mkbase*" \
        -o -name "*zzsetenv.def*" \
        -o -name "*install*" \) \
        -exec sed -i -e "s|/iraf/iraf|$$PREFIX/iraf|g" '{}' \;

    export CFLAGS="-arch i386 -m32 -I$$FAKEHOME/ -I $$iraf/include -I$$iraf/bin"
    export LDFLAGS="-arch i386"

	mkdir -p override
	ln -sf /usr/bin/libtool override/
	ln -sf /usr/bin/ranlib override/
	export PATH=$$iraf/override:$$PATH

    rm -rf include
    mkdir -p include
    
    #ln -s ../unix/hlib/libc/iraf.h $$FAKEHOME/
    ln -s ../unix/hlib/libc/iraf.h $$iraf/include/
    ln -s ../unix/bin/f2c.h $$iraf/include/
    cp $$iraf/unix/hlib/libc/vosproto.h $$iraf/include/
    cp $$iraf/unix/boot/xyacc/yaccpar.x $$iraf/include/
    mkdir -p $$iraf/include/curl && touch $$iraf/include/curl/types.h
    
    touch $$iraf/extern/.zzsetenv.def
    
    echo '$$set XFLAGS  = "$$(XFLAGS) -/I$$(iraf)fakehome -/I$$(iraf)include"'  >> unix/hlib/mkpkg.inc
    echo '$$set XVFLAGS = "$$(XVFLAGS) -/I$$(iraf)fakehome -/I$$(iraf)include"' >> unix/hlib/mkpkg.inc
    echo '$$set LFLAGS  = "$$(LFLAGS) -/I$$(iraf)fakehome -/I$$(iraf)include" -/L$$(iraf)bin -/$$(iraf)bin.$$(IRAFARCH)' >> unix/hlib/mkpkg.inc

    ( cd unix/f2c/src && \
        make -f makefile.u CFLAGS="$$CFLAGS" LDFLAGS="$$LDFLAGS" && \
        cp f2c $$iraf/unix/bin.$$IRAFARCH/f2c.e )
    
    ( cd unix/f2c/libf2c && \
        make -f makefile.u CFLAGS="$$CFLAGS" LDFLAGS="$$LDFLAGS" && \
        cp f2c.h libf2c.a $$iraf/unix/bin.$$IRAFARCH/ )
    
	( make $$IRAFARCH && \
        util/mksysgen )

windows:
    echo Not supported on Windows