Selaa lähdekoodia

first travis push

Ugochukwu Mmaduekwe 7 vuotta sitten
vanhempi
sitoutus
13fcdb6ae9
2 muutettua tiedostoa jossa 70 lisäystä ja 57 poistoa
  1. 34 35
      .travis.install.py
  2. 36 22
      .travis.yml

+ 34 - 35
.travis.install.py

@@ -7,49 +7,47 @@ import os
 import subprocess
 import subprocess
 
 
 OS_NAME=os.environ.get('TRAVIS_OS_NAME') or 'linux'
 OS_NAME=os.environ.get('TRAVIS_OS_NAME') or 'linux'
-#OS_PMAN={'linux': 'sudo apt-get', 'osx': 'brew'}[OS_NAME]
-OS_PMAN={'linux': 'sudo apt-get'}[OS_NAME]
+OS_PMAN={'linux': 'sudo apt-get', 'osx': 'brew'}[OS_NAME]
 
 
 LAZ_TMP_DIR=os.environ.get('LAZ_TMP_DIR') or 'lazarus_tmp'
 LAZ_TMP_DIR=os.environ.get('LAZ_TMP_DIR') or 'lazarus_tmp'
-#LAZ_REL_DEF=os.environ.get('LAZ_REL_DEF') or {'linux':'amd64', 'qemu-arm':'amd64', 'qemu-arm-static':'amd64', 'osx':'i386', 'wine':'32'}
-LAZ_REL_DEF=os.environ.get('LAZ_REL_DEF') or {'linux':'amd64', 'qemu-arm':'amd64', 'qemu-arm-static':'amd64', 'wine':'32'}
+LAZ_REL_DEF=os.environ.get('LAZ_REL_DEF') or {'linux':'amd64', 'qemu-arm':'amd64', 'qemu-arm-static':'amd64', 'osx':'i386', 'wine':'32'}
 LAZ_BIN_SRC=os.environ.get('LAZ_BIN_SRC') or 'http://mirrors.iwi.me/lazarus/releases/%(target)s/Lazarus%%20%(version)s'
 LAZ_BIN_SRC=os.environ.get('LAZ_BIN_SRC') or 'http://mirrors.iwi.me/lazarus/releases/%(target)s/Lazarus%%20%(version)s'
 LAZ_BIN_TGT=os.environ.get('LAZ_BIN_TGT') or {
 LAZ_BIN_TGT=os.environ.get('LAZ_BIN_TGT') or {
     'linux':           'Lazarus%%20Linux%%20%(release)s%%20DEB',
     'linux':           'Lazarus%%20Linux%%20%(release)s%%20DEB',
     'qemu-arm':        'Lazarus%%20Linux%%20%(release)s%%20DEB',
     'qemu-arm':        'Lazarus%%20Linux%%20%(release)s%%20DEB',
     'qemu-arm-static': 'Lazarus%%20Linux%%20%(release)s%%20DEB',
     'qemu-arm-static': 'Lazarus%%20Linux%%20%(release)s%%20DEB',
-#    'osx':             'Lazarus%%20Mac%%20OS%%20X%%20%(release)s',
+    'osx':             'Lazarus%%20Mac%%20OS%%20X%%20%(release)s',
     'wine':            'Lazarus%%20Windows%%20%(release)s%%20bits'
     'wine':            'Lazarus%%20Windows%%20%(release)s%%20bits'
 }
 }
 
 
-#def install_osx_dmg(dmg):
-#    try:
-#        # Mount .dmg file and parse (automatically determined) target volumes
-#        res = subprocess.check_output('sudo hdiutil attach %s | grep /Volumes/' % (dmg), shell=True)
-#        vol = ('/Volumes/' + l.strip().split('/Volumes/')[-1] for l in res.splitlines() if '/Volumes/' in l)
-#    except:
-#        return False
-#
-#    # Install .pkg files with installer
-#    install_pkg = lambda v, f: os.system('sudo installer -pkg %s/%s -target /' % (v, f)) == 0
-#
-#    for v in vol:
-#        try:
-#            if not all(map(lambda f: (not f.endswith('.pkg')) or install_pkg(v, f), os.listdir(v))):
-#                return False
-#        finally:
-#            # Unmount after installation
-#            os.system('hdiutil detach %s' % (v))
-#
-#    return True
+def install_osx_dmg(dmg):
+    try:
+        # Mount .dmg file and parse (automatically determined) target volumes
+        res = subprocess.check_output('sudo hdiutil attach %s | grep /Volumes/' % (dmg), shell=True)
+        vol = ('/Volumes/' + l.strip().split('/Volumes/')[-1] for l in res.splitlines() if '/Volumes/' in l)
+    except:
+        return False
+
+    # Install .pkg files with installer
+    install_pkg = lambda v, f: os.system('sudo installer -pkg %s/%s -target /' % (v, f)) == 0
+
+    for v in vol:
+        try:
+            if not all(map(lambda f: (not f.endswith('.pkg')) or install_pkg(v, f), os.listdir(v))):
+                return False
+        finally:
+            # Unmount after installation
+            os.system('hdiutil detach %s' % (v))
+
+    return True
 
 
 def install_lazarus_default():
 def install_lazarus_default():
     if OS_NAME == 'linux':
     if OS_NAME == 'linux':
         # Make sure nogui is installed for headless runs
         # Make sure nogui is installed for headless runs
         pkg = 'lazarus lcl-nogui'
         pkg = 'lazarus lcl-nogui'
-#    elif OS_NAME == 'osx':
-#        # Install brew cask first
-#        pkg = 'fpc caskroom/cask/brew-cask && %s cask install fpcsrc lazarus' % (OS_PMAN)
+    elif OS_NAME == 'osx':
+        # Install brew cask first
+        pkg = 'fpc caskroom/cask/brew-cask && %s cask install fpcsrc lazarus' % (OS_PMAN)
     else:
     else:
         # Default to lazarus
         # Default to lazarus
         pkg = 'lazarus'
         pkg = 'lazarus'
@@ -91,9 +89,9 @@ def install_lazarus_version(ver,rel,env):
 
 
         # Install all .deb files
         # Install all .deb files
         process_file = lambda f: (not f.endswith('.deb')) or os.system('sudo dpkg --force-overwrite -i %s' % (f)) == 0
         process_file = lambda f: (not f.endswith('.deb')) or os.system('sudo dpkg --force-overwrite -i %s' % (f)) == 0
-#    elif osn == 'osx':
-#        # Install all .dmg files
-#        process_file = lambda f: (not f.endswith('.dmg')) or install_osx_dmg(f)
+    elif osn == 'osx':
+        # Install all .dmg files
+        process_file = lambda f: (not f.endswith('.dmg')) or install_osx_dmg(f)
     else:
     else:
         return False
         return False
 
 
@@ -109,7 +107,7 @@ def install_lazarus_version(ver,rel,env):
         # Redirect listed executables so they execute in wine
         # Redirect listed executables so they execute in wine
         for alias in ('fpc', 'lazbuild', 'lazarus'):
         for alias in ('fpc', 'lazbuild', 'lazarus'):
             os.system('echo "#!/usr/bin/env bash \nwine %(target)s \$@" | sudo tee %(name)s > /dev/null && sudo chmod +x %(name)s' % {
             os.system('echo "#!/usr/bin/env bash \nwine %(target)s \$@" | sudo tee %(name)s > /dev/null && sudo chmod +x %(name)s' % {
-                'target': alias,
+                'target': subprocess.check_output("find $WINEPREFIX -iname '%s.exe' | head -1 " % (alias), shell=True).strip(),
                 'name': '/usr/bin/%s' % (alias)
                 'name': '/usr/bin/%s' % (alias)
             })
             })
     elif osn == 'qemu-arm' or osn == 'qemu-arm-static':
     elif osn == 'qemu-arm' or osn == 'qemu-arm-static':
@@ -127,7 +125,7 @@ def install_lazarus_version(ver,rel,env):
         # Compile ARM cross compiler
         # Compile ARM cross compiler
         if os.system('cd /usr/share/fpcsrc/%s && sudo make clean crossall crossinstall %s' % (fpcv, opts)) != 0:
         if os.system('cd /usr/share/fpcsrc/%s && sudo make clean crossall crossinstall %s' % (fpcv, opts)) != 0:
             return False
             return False
-
+        
         # Symbolic link to update default FPC cross compiler for ARM
         # Symbolic link to update default FPC cross compiler for ARM
         if os.system('sudo ln -sf /usr/lib/fpc/%s/ppcrossarm /usr/bin/ppcarm' % (fpcv)) != 0:
         if os.system('sudo ln -sf /usr/lib/fpc/%s/ppcrossarm /usr/bin/ppcarm' % (fpcv)) != 0:
             return False
             return False
@@ -142,7 +140,8 @@ def install_lazarus_version(ver,rel,env):
             '-Fl/usr/lib/gcc/arm-linux-gnueabi/%s' % (gccv),
             '-Fl/usr/lib/gcc/arm-linux-gnueabi/%s' % (gccv),
             '-Fl/usr/lib/gcc-cross/arm-linux-gnueabi/%s' % (gccv),
             '-Fl/usr/lib/gcc-cross/arm-linux-gnueabi/%s' % (gccv),
             # '-CpARMV7A', '-CfVFPV3_D16',
             # '-CpARMV7A', '-CfVFPV3_D16',
-            '#ENDIF'
+            '#ENDIF',
+            ''
         ])
         ])
         with open(os.path.expanduser('~/.fpc.cfg'),'w') as f:
         with open(os.path.expanduser('~/.fpc.cfg'),'w') as f:
             f.write(config)
             f.write(config)
@@ -157,4 +156,4 @@ def main():
     return install_lazarus(os.environ.get('LAZ_VER'),os.environ.get('LAZ_REL'),os.environ.get('LAZ_ENV'))
     return install_lazarus(os.environ.get('LAZ_VER'),os.environ.get('LAZ_REL'),os.environ.get('LAZ_ENV'))
 
 
 if __name__ == '__main__':
 if __name__ == '__main__':
-    sys.exit(int(not main()))
+    sys.exit(int(not main()))

+ 36 - 22
.travis.yml

@@ -1,54 +1,68 @@
 # Part of `travis-lazarus` (https://github.com/nielsAD/travis-lazarus)
 # Part of `travis-lazarus` (https://github.com/nielsAD/travis-lazarus)
 # License: MIT
 # License: MIT
 
 
-#group: deprecated-2017Q2
 language: generic
 language: generic
 sudo: required
 sudo: required
-#sudo: false
 dist: trusty
 dist: trusty
 
 
 os:
 os:
   - linux
   - linux
- # - osx
+  - osx
 
 
 env:
 env:
   global:
   global:
     - WINEPREFIX=~/.winelaz
     - WINEPREFIX=~/.winelaz
     - DISPLAY=:99.0
     - DISPLAY=:99.0
- # matrix:
- #   - LAZ_PKG=true  # Use the latest version from the default package manager
- #   - LAZ_VER=1.6.4
+  matrix:
+   # - LAZ_PKG=true  # Use the latest version from the default package manager
+    - LAZ_VER=1.6 # Use specific (binary) release
+    - LAZ_VER=1.8.0
+   # FPC 3.0.4 Linker Fails in Old Linux OS, See 
+   # https://forum.lazarus.freepascal.org/index.php?topic=40238.0 and https://bugs.freepascal.org/view.php?id=32251
+   # - LAZ_VER=1.8.4
 
 
 matrix:
 matrix:
   include:
   include:
     - os: linux
     - os: linux
-      env: LAZ_VER=1.6.4  LAZ_ENV=wine WINEARCH=win32 LAZ_OPT="--os=win32 --cpu=i386"
+      env: LAZ_VER=1.6  LAZ_ENV=wine WINEARCH=win32 LAZ_OPT="--os=win32 --cpu=i386"
     - os: linux
     - os: linux
-      env: LAZ_VER=1.6.4  LAZ_ENV=wine WINEARCH=win64 LAZ_OPT="--os=win64 --cpu=x86_64"
- #   - os: linux
- #     env: LAZ_VER=1.6.4  LAZ_ENV=qemu-arm LAZ_OPT="--os=linux --cpu=arm"
-
- # Use https (public access) instead of git for git-submodules. This modifies only Travis-CI behavior!
-
-# disable the default submodule logic
-git:
-submodules: false
+      env: LAZ_VER=1.8.0 LAZ_ENV=wine WINEARCH=win32 LAZ_OPT="--os=win32 --cpu=i386"
+    - os: linux
+      env: LAZ_VER=1.8.4 LAZ_ENV=wine WINEARCH=win32 LAZ_OPT="--os=win32 --cpu=i386"
+    - os: linux
+      env: LAZ_VER=1.6  LAZ_ENV=wine WINEARCH=win64 LAZ_OPT="--os=win64 --cpu=x86_64"
+    - os: linux
+      env: LAZ_VER=1.8.0 LAZ_ENV=wine WINEARCH=win64 LAZ_OPT="--os=win64 --cpu=x86_64"
+    - os: linux
+      env: LAZ_VER=1.8.4 LAZ_ENV=wine WINEARCH=win64 LAZ_OPT="--os=win64 --cpu=x86_64"
+    - os: linux
+      env: LAZ_VER=1.6  LAZ_ENV=qemu-arm LAZ_OPT="--os=linux --cpu=arm"
+    - os: linux
+      env: LAZ_VER=1.8.0 LAZ_ENV=qemu-arm LAZ_OPT="--os=linux --cpu=arm"
+    - os: linux
+      env: LAZ_VER=1.8.4 LAZ_ENV=qemu-arm LAZ_OPT="--os=linux --cpu=arm"
 
 
 before_install:
 before_install:
   # Start virtual display server
   # Start virtual display server
   - Xvfb $DISPLAY &
   - Xvfb $DISPLAY &
-  - chmod +x .travis.install.py
-  # use sed to replace the SSH URL with the public URL, then init and update submodules
-  - sed -i 's/[email protected]:/https:\/\/github.com\//' .gitmodules
-  - git submodule update --init --recursive
+  - chmod +x .travis.install.py 
 
 
 install:
 install:
   # Install prerequisites (fpc/lazarus/wine/qemu)
   # Install prerequisites (fpc/lazarus/wine/qemu)
   - ./.travis.install.py
   - ./.travis.install.py
 
 
 script:
 script:
-  - lazbuild $LAZ_OPT ./CryptoLib.Tests/FreePascal.Tests/CryptoLibConsole.Tests.lpi               # Build CryptoLib4Pascal Test Project
-  - $LAZ_ENV ./CryptoLib.Tests/FreePascal.Tests/bin/CryptoLib --all --format=plain # Run CryptoLib4Pascal TestSuite
+  - curl -o ./HashLib4Pascal.zip https://github.com/Xor-el/HashLib4Pascal/archive/master.zip
+  - curl -o ./SimpleBaseLib4Pascal.zip https://github.com/Xor-el/SimpleBaseLib4Pascal/archive/master.zip
+  - unzip ./HashLib4Pascal.zip
+  - unzip ./SimpleBaseLib4Pascal.zip
+  - lazbuild --add-package-link ./HashLib4Pascal-master/HashLib/src/Packages/FPC/HashLib4PascalPackage.lpk  # Add HashLib4Pascal Package
+  - lazbuild --add-package-link ./SimpleBaseLib4Pascal-master/SimpleBaseLib/src/Packages/FPC/SimpleBaseLib4PascalPackage.lpk  # Add SimpleBaseLib4Pascal Package
+  - lazbuild $LAZ_OPT ./HashLib4Pascal-master/HashLib/src/Packages/FPC/HashLib4PascalPackage.lpk  # Build HashLib4Pascal Package
+  - lazbuild $LAZ_OPT ./SimpleBaseLib4Pascal-master/SimpleBaseLib/src/Packages/FPC/SimpleBaseLib4PascalPackage.lpk  # Build SimpleBaseLib4Pascal Package
+  - lazbuild $LAZ_OPT ./CryptoLib/src/Packages/FPC/CryptoLib4PascalPackage.lpk  # Build CryptoLib4Pascal Package
+  - lazbuild $LAZ_OPT ./CryptoLib.Tests/FreePascal.Tests/CryptoLibConsole.Tests.lpi  # Build CryptoLib4Pascal Test Project
+  - travis_wait 120 $LAZ_ENV ./CryptoLib.Tests/FreePascal.Tests/bin/CryptoLib --all --format=plain # Run CryptoLib4Pascal TestSuite with timeout of 120 mins
 
 
 notifications:
 notifications:
   email:
   email: