pkgsrc-Changes archive

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

CVS commit: pkgsrc/devel/astyle



Module Name:    pkgsrc
Committed By:   schmonz
Date:           Sat Mar 17 17:16:59 UTC 2018

Modified Files:
        pkgsrc/devel/astyle: Makefile distinfo
Added Files:
        pkgsrc/devel/astyle/patches: patch-build_mac_Makefile

Log Message:
Fix build on Darwin (at least 17.4.0) by including the Darwin makefile
from the "macos" source tarball, which differs from the "linux" one used
here only by which build instructions it contains.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 pkgsrc/devel/astyle/Makefile
cvs rdiff -u -r1.16 -r1.17 pkgsrc/devel/astyle/distinfo
cvs rdiff -u -r0 -r1.1 pkgsrc/devel/astyle/patches/patch-build_mac_Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/devel/astyle/Makefile
diff -u pkgsrc/devel/astyle/Makefile:1.20 pkgsrc/devel/astyle/Makefile:1.21
--- pkgsrc/devel/astyle/Makefile:1.20   Sun Feb 18 04:34:20 2018
+++ pkgsrc/devel/astyle/Makefile        Sat Mar 17 17:16:59 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.20 2018/02/18 04:34:20 rillig Exp $
+# $NetBSD: Makefile,v 1.21 2018/03/17 17:16:59 schmonz Exp $
 
 DISTNAME=      astyle_3.1_linux
 PKGNAME=       ${DISTNAME:S/_linux//:S/_/-/}
@@ -11,13 +11,19 @@ COMMENT=    Free, Fast and Small Automatic 
 LICENSE=       gnu-lgpl-v3
 
 WRKSRC=                ${WRKDIR}/astyle
-BUILD_DIRS=    build/gcc
 USE_TOOLS+=    gmake
 USE_LANGUAGES= c++
 AUTO_MKDIRS=   yes
 
+.include "../../mk/bsd.prefs.mk"
+.if ${OPSYS} == "Darwin"
+BUILD_DIRS=    build/mac
+.else
+BUILD_DIRS=    build/gcc
+.endif
+
 do-install:
-       ${INSTALL_PROGRAM} ${WRKSRC}/build/gcc/bin/astyle ${DESTDIR}${PREFIX}/bin
+       ${INSTALL_PROGRAM} ${WRKSRC}/${BUILD_DIRS}/bin/astyle ${DESTDIR}${PREFIX}/bin
        cd ${WRKSRC}/doc && ${INSTALL_DATA} * ${DESTDIR}${PREFIX}/share/doc/astyle
 
 .include "../../converters/libiconv/buildlink3.mk"

Index: pkgsrc/devel/astyle/distinfo
diff -u pkgsrc/devel/astyle/distinfo:1.16 pkgsrc/devel/astyle/distinfo:1.17
--- pkgsrc/devel/astyle/distinfo:1.16   Sun Feb 18 04:34:20 2018
+++ pkgsrc/devel/astyle/distinfo        Sat Mar 17 17:16:59 2018
@@ -1,6 +1,7 @@
-$NetBSD: distinfo,v 1.16 2018/02/18 04:34:20 rillig Exp $
+$NetBSD: distinfo,v 1.17 2018/03/17 17:16:59 schmonz Exp $
 
 SHA1 (astyle_3.1_linux.tar.gz) = 84814b8bb4e52489687f2bce3c2d57ce7d3dcebe
 RMD160 (astyle_3.1_linux.tar.gz) = a8225fc99f11d681eeef55e1d812fe9a88d13685
 SHA512 (astyle_3.1_linux.tar.gz) = 2e8f13d291abda66bbba30174c364c81a81a490e0a21376f7da7cf471644c22caa37b9eefb100d093bf26d1a8bfa9d2f14b4c2a9b75b3cb84428b4514e277ff2
 Size (astyle_3.1_linux.tar.gz) = 185589 bytes
+SHA1 (patch-build_mac_Makefile) = ac8b4f69ec2b2f2cb3c87db140c2783b24009e2c

Added files:

Index: pkgsrc/devel/astyle/patches/patch-build_mac_Makefile
diff -u /dev/null pkgsrc/devel/astyle/patches/patch-build_mac_Makefile:1.1
--- /dev/null   Sat Mar 17 17:16:59 2018
+++ pkgsrc/devel/astyle/patches/patch-build_mac_Makefile        Sat Mar 17 17:16:59 2018
@@ -0,0 +1,225 @@
+$NetBSD: patch-build_mac_Makefile,v 1.1 2018/03/17 17:16:59 schmonz Exp $
+
+Include Darwin makefile from the "macos" source tarball.
+
+--- build/mac/Makefile.orig    2018-03-17 17:07:25.000000000 +0000
++++ build/mac/Makefile
+@@ -0,0 +1,218 @@
++# Make file for Clang compiler on macOS.
++
++# to test on Linux use "make  linux=1"
++
++# list of source files for astyle
++SRC = astyle_main.cpp \
++      ASBeautifier.cpp \
++      ASFormatter.cpp \
++      ASEnhancer.cpp \
++      ASLocalizer.cpp \
++      ASResource.cpp
++
++# list of source files for libraries without ASLocalizer
++SRCx = astyle_main.cpp \
++       ASBeautifier.cpp \
++       ASFormatter.cpp \
++       ASEnhancer.cpp \
++       ASResource.cpp
++
++# source directories
++vpath %.cpp ../../src
++vpath %.h   ../../src
++
++# NOTE for java compiles the environment variable $JAVA_HOME must be set
++# example: export JAVA_HOME=/usr/lib/jvm/java-6-sun-1.6.0.00
++ifndef JAVA_HOME
++    JAVA_HOME = /usr/lib/jvm/default-java
++endif
++
++# set prefix if not defined on the command line
++ifndef prefix
++    prefix=/usr
++endif
++SYSCONF_PATH=$(prefix)/share/doc/astyle
++
++# define macros
++dylib = dylib
++dynamiclib = -dynamiclib
++bindir = bin
++objdir = obj
++ipath=$(prefix)/bin
++CBASEFLAGS = -W -Wall -std=c++11 -stdlib=libc++ -fno-rtti -fno-exceptions  \
++-mmacosx-version-min=10.9
++LDBASEFLAGS = 
++JAVAINCS  = -I/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/include \
++-I/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/include/darwin \
++-I/System/Library/Frameworks/JavaVM.framework/Headers
++CXX = clang++
++INSTALL=install -o $(USER) -g wheel
++# INSTALL=install -o 0 -g 0
++
++# for testing on linux
++ifdef linux
++    dylib = so
++    dynamiclib = -shared
++    CXX = g++
++    JAVAINCS   = -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux
++endif
++
++##################################################
++
++# define compile options for each build
++ifdef CFLAGS
++    CFLAGSr   = -DNDEBUG $(CBASEFLAGS) $(CFLAGS)
++    CFLAGSd   = -g $(CBASEFLAGS) $(CFLAGS)
++else
++    CFLAGSr   = -DNDEBUG -O3 $(CBASEFLAGS)
++    CFLAGSd   = -g $(CBASEFLAGS)
++endif
++CFLAGSs   = -DASTYLE_LIB -fPIC $(CFLAGSr)
++CFLAGSsd  = -DASTYLE_LIB -fPIC $(CFLAGSd)
++CFLAGSa   = -DASTYLE_LIB $(CFLAGSr)
++CFLAGSad  = -DASTYLE_LIB $(CFLAGSd)
++CFLAGSsj  = -DASTYLE_JNI -fPIC $(CFLAGSr) $(JAVAINCS)
++CFLAGSsjd = -DASTYLE_JNI -fPIC $(CFLAGSd) $(JAVAINCS)
++
++# define link options
++ifdef LDFLAGS
++    LDFLAGSr = $(LDBASEFLAGS) $(LDFLAGS)
++    LDFLAGSd = $(LDBASEFLAGS) $(LDFLAGS)
++else
++    LDFLAGSr = $(LDBASEFLAGS)
++    LDFLAGSd = $(LDBASEFLAGS)
++endif
++
++# object files are built from the source list $(SRC)
++# a suffix is added for each build
++OBJ   = $(patsubst %.cpp,$(objdir)/%.o,$(SRC))
++OBJd  = $(patsubst %.cpp,$(objdir)/%_d.o,$(SRC))
++OBJs  = $(patsubst %.cpp,$(objdir)/%_s.o,$(SRCx))
++OBJsd = $(patsubst %.cpp,$(objdir)/%_sd.o,$(SRCx))
++OBJa  = $(patsubst %.cpp,$(objdir)/%_a.o,$(SRCx))
++OBJad = $(patsubst %.cpp,$(objdir)/%_ad.o,$(SRCx))
++OBJsj  = $(patsubst %.cpp,$(objdir)/%_sj.o,$(SRCx))
++OBJsjd = $(patsubst %.cpp,$(objdir)/%_sjd.o,$(SRCx))
++
++# define object file rule (with the suffix) for each build
++
++# OBJ
++$(objdir)/%.o:  %.cpp  astyle.h  astyle_main.h
++      @ mkdir -p $(objdir)
++      $(CXX) $(CFLAGSr) -c $< -o $@
++
++# OBJd
++$(objdir)/%_d.o:  %.cpp  astyle.h  astyle_main.h
++      @ mkdir -p $(objdir)
++      $(CXX) $(CFLAGSd) -c $< -o $@
++
++# OBJs
++$(objdir)/%_s.o:  %.cpp  astyle.h
++      @ mkdir -p $(objdir)
++      $(CXX) $(CFLAGSs) -c $< -o $@
++
++# OBJsd
++$(objdir)/%_sd.o:  %.cpp  astyle.h
++      @ mkdir -p $(objdir)
++      $(CXX) $(CFLAGSsd) -c $< -o $@
++
++# OBJa
++$(objdir)/%_a.o:  %.cpp  astyle.h
++      @ mkdir -p $(objdir)
++      $(CXX) $(CFLAGSa) -c $< -o $@
++
++# OBJad
++$(objdir)/%_ad.o:  %.cpp  astyle.h
++      @ mkdir -p $(objdir)
++      $(CXX) $(CFLAGSad) -c $< -o $@
++
++# OBJsj
++$(objdir)/%_sj.o:  %.cpp  astyle.h
++      @ mkdir -p $(objdir)
++      $(CXX) $(CFLAGSsj) -c $< -o $@
++
++# OBJsjd
++$(objdir)/%_sjd.o:  %.cpp  astyle.h
++      @ mkdir -p $(objdir)
++      $(CXX) $(CFLAGSsjd) -c $< -o $@
++
++##################################################
++# define build dependencies for each command
++
++release:  astyle
++astyle:  $(OBJ)
++      @ mkdir -p $(bindir)
++      $(CXX) $(LDFLAGSr) -dead_strip -o $(bindir)/AStyle $^
++      strip $(bindir)/AStyle
++      @ echo
++
++debug:  astyled
++astyled:  $(OBJd)
++      @ mkdir -p $(bindir)
++      $(CXX) $(LDFLAGSd) -o $(bindir)/AStyled $^
++      @ echo
++
++shared:  libastyle.$(dylib)
++libastyle.$(dylib):  $(OBJs)
++      @ mkdir -p $(bindir)
++      $(CXX) $(dynamiclib) $(LDFLAGSr) -o $(bindir)/libastyle31.$(dylib) $^
++      @ echo
++
++shareddebug:  libastyled.$(dylib)
++libastyled.$(dylib):  $(OBJsd)
++      @ mkdir -p $(bindir)
++      $(CXX) $(dynamiclib) $(LDFLAGSd) -o $(bindir)/libastyle31d.$(dylib) $^
++      @ echo
++
++static:  libastyle.a
++libastyle.a:  $(OBJa)
++      @ mkdir -p $(bindir)
++      ar crs $(bindir)/$@ $^
++      @ echo
++
++staticdebug:  libastyled.a
++libastyled.a:  $(OBJad)
++      @ mkdir -p $(bindir)
++      ar crs $(bindir)/$@ $^
++      @ echo
++
++java:  libastylej.$(dylib)
++libastylej.$(dylib):  $(OBJsj)
++      @ mkdir -p $(bindir)
++      $(CXX) $(dynamiclib) $(LDFLAGSr) -o $(bindir)/libastyle31j.$(dylib) $^
++      @ echo
++
++javadebug:  libastylejd.$(dylib)
++libastylejd.$(dylib):  $(OBJsjd)
++      @ mkdir -p $(bindir)
++      $(CXX) $(dynamiclib) $(LDFLAGSd) -o $(bindir)/libastyle31jd.$(dylib) $^
++      @ echo
++
++all:  release debug shared shareddebug static staticdebug
++
++javaall:  java javadebug
++
++clean:
++      rm -f $(objdir)/*.o $(bindir)/*astyle*
++
++cleanobj:
++      rm -f $(objdir)/*.o
++
++install:
++      $(INSTALL) -m 755 -d $(ipath)
++      @$(INSTALL) -m 755 $(bindir)/astyle  $(ipath)
++
++      @if [ -d $(SYSCONF_PATH)/html ]; then \
++              rm -rf  $(SYSCONF_PATH)/html; \
++      fi
++
++      $(INSTALL) -m 755 -d $(SYSCONF_PATH)
++      @mkdir -p $(SYSCONF_PATH)/html;
++      @for files in ../../doc/*.html  ../../doc/*.css; \
++      do \
++              $(INSTALL)  -m 644  "$$files"  $(SYSCONF_PATH)/html; \
++      done
++
++uninstall:
++      rm -f $(ipath)/astyle
++      rm -rf $(SYSCONF_PATH)



Home | Main Index | Thread Index | Old Index