Browse Source

adjustments for master branch

Ugochukwu Mmaduekwe 7 years ago
parent
commit
4bea2dc825

+ 0 - 159
.travis.install.py

@@ -1,159 +0,0 @@
-#!/usr/bin/env python
-# Part of `travis-lazarus` (https://github.com/nielsAD/travis-lazarus)
-# License: MIT
-
-import sys
-import os
-import subprocess
-
-OS_NAME=os.environ.get('TRAVIS_OS_NAME') or 'linux'
-OS_PMAN={'linux': 'sudo apt-get', 'osx': 'brew'}[OS_NAME]
-
-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_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 {
-    'linux':           'Lazarus%%20Linux%%20%(release)s%%20DEB',
-    'qemu-arm':        'Lazarus%%20Linux%%20%(release)s%%20DEB',
-    'qemu-arm-static': 'Lazarus%%20Linux%%20%(release)s%%20DEB',
-    'osx':             'Lazarus%%20Mac%%20OS%%20X%%20%(release)s',
-    '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_lazarus_default():
-    if OS_NAME == 'linux':
-        # Make sure nogui is installed for headless runs
-        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)
-    else:
-        # Default to lazarus
-        pkg = 'lazarus'
-    return os.system('%s install %s' % (OS_PMAN, pkg)) == 0
-
-def install_lazarus_version(ver,rel,env):
-    # Download all files in directory for specified Lazarus version
-    osn = env or OS_NAME
-    tgt = LAZ_BIN_TGT[osn] % {'release': rel or LAZ_REL_DEF[osn]}
-    src = LAZ_BIN_SRC % {'target': tgt, 'version': ver}
-    if os.system('wget -r -l1 -T 30 -np -nd -nc -A .deb,.dmg,.exe %s -P %s' % (src, LAZ_TMP_DIR)) != 0:
-        return False
-
-    if osn == 'wine':
-        # Install wine and Xvfb
-        if os.system('sudo dpkg --add-architecture i386 && %s update && %s install xvfb wine' % (OS_PMAN, OS_PMAN)) != 0:
-            return False
-
-        # Initialize virtual display and wine directory
-        if os.system('Xvfb %s & sleep 3 && wineboot -i' % (os.environ.get('DISPLAY') or '')) != 0:
-            return False
-
-        # Install basic Wine prerequisites, ignore failure
-        os.system('winetricks -q corefonts')
-
-        # Install all .exe files with wine
-        process_file = lambda f: (not f.endswith('.exe')) or os.system('wine %s /VERYSILENT /DIR="c:\\lazarus"' % (f)) == 0
-    elif osn == 'qemu-arm' or osn == 'qemu-arm-static':
-        # Install qemu and arm cross compiling utilities
-        if os.system('%s install libgtk2.0-dev qemu-user qemu-user-static binutils-arm-linux-gnueabi gcc-arm-linux-gnueabi' % (OS_PMAN)) != 0:
-            return False
-
-        # Install all .deb files (for linux) and cross compile later
-        process_file = lambda f: (not f.endswith('.deb')) or os.system('sudo dpkg --force-overwrite -i %s' % (f)) == 0
-    elif osn == 'linux':
-        # Install dependencies
-        if os.system('%s install libgtk2.0-dev' % (OS_PMAN)) != 0:
-            return False
-
-        # Install all .deb files
-        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)
-    else:
-        return False
-
-    # Process all downloaded files
-    if not all(map(lambda f: process_file(os.path.join(LAZ_TMP_DIR, f)), sorted(os.listdir(LAZ_TMP_DIR)))):
-        return False
-
-    if osn == 'wine':
-        # Set wine Path (persistently) to include Lazarus binary directory
-        if os.system('wine cmd /C reg add HKEY_CURRENT_USER\\\\Environment /v PATH /t REG_SZ /d "%PATH%\\;c:\\\\lazarus"') != 0:
-            return False
-
-        # Redirect listed executables so they execute in wine
-        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' % {
-                'target': subprocess.check_output("find $WINEPREFIX -iname '%s.exe' | head -1 " % (alias), shell=True).strip(),
-                'name': '/usr/bin/%s' % (alias)
-            })
-    elif osn == 'qemu-arm' or osn == 'qemu-arm-static':
-        fpcv = subprocess.check_output('fpc -iV', shell=True).strip()
-        gccv = subprocess.check_output('arm-linux-gnueabi-gcc -dumpversion', shell=True).strip()
-        opts = ' '.join([
-            'CPU_TARGET=arm',
-            'OS_TARGET=linux',
-            'BINUTILSPREFIX=arm-linux-gnueabi-',
-            # 'CROSSOPT="-CpARMV7A -CfVFPV3_D16"',
-            'OPT=-dFPC_ARMEL',
-            'INSTALL_PREFIX=/usr'
-        ])
-
-        # Compile ARM cross compiler
-        if os.system('cd /usr/share/fpcsrc/%s && sudo make clean crossall crossinstall %s' % (fpcv, opts)) != 0:
-            return False
-        
-        # 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:
-            return False
-
-        # Update config file with paths to ARM libraries
-        config = '\n'.join([
-            '#INCLUDE /etc/fpc.cfg',
-            '#IFDEF CPUARM',
-            '-Xd','-Xt',
-            '-XParm-linux-gnueabi-',
-            '-Fl/usr/arm-linux-gnueabi/lib',
-            '-Fl/usr/lib/gcc/arm-linux-gnueabi/%s' % (gccv),
-            '-Fl/usr/lib/gcc-cross/arm-linux-gnueabi/%s' % (gccv),
-            # '-CpARMV7A', '-CfVFPV3_D16',
-            '#ENDIF',
-            ''
-        ])
-        with open(os.path.expanduser('~/.fpc.cfg'),'w') as f:
-            f.write(config)
-
-    return True
-
-def install_lazarus(ver=None,rel=None,env=None):
-    return install_lazarus_version(ver,rel,env) if ver else install_lazarus_default()
-
-def main():
-    os.system('%s update' % (OS_PMAN))
-    return install_lazarus(os.environ.get('LAZ_VER'),os.environ.get('LAZ_REL'),os.environ.get('LAZ_ENV'))
-
-if __name__ == '__main__':
-    sys.exit(int(not main()))

+ 0 - 80
.travis.yml

@@ -1,80 +0,0 @@
-# Part of `travis-lazarus` (https://github.com/nielsAD/travis-lazarus)
-# License: MIT
-
-language: generic
-sudo: required
-dist: trusty
-
-os:
-  - linux
-  - osx
-
-env:
-  global:
-    - WINEPREFIX=~/.winelaz
-    - DISPLAY=:99.0
-  matrix:
-   # - LAZ_PKG=true  # Use the latest version from the default package manager
-    - LAZ_VER=1.6.4 # Use specific (binary) release
-    - LAZ_VER=1.8.0
-    - LAZ_VER=1.8.4
-
-matrix:
-  include:
-    - os: linux
-      env: LAZ_VER=1.6.4  LAZ_ENV=wine WINEARCH=win32 LAZ_OPT="--os=win32 --cpu=i386"
-    - os: linux
-      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.4  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.4  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:
-  # Start virtual display server
-  - Xvfb $DISPLAY &
-  - if [ "$TRAVIS_OS_NAME" == "linux" ]; then
-          sudo apt-get update;
-          sudo apt-get install binutils-2.26;
-          sudo ln -sf /usr/lib/binutils-2.26/bin/* /usr/bin/;
-          sudo ln -sf /usr/lib/binutils-2.26/ldscripts/* /usr/lib/ldscripts/;
-    fi
-  - chmod +x .travis.install.py 
-
-install:
-  # Install prerequisites (fpc/lazarus/wine/qemu)
-  - ./.travis.install.py
-
-script:
-  - curl -L -k https://github.com/Xor-el/HashLib4Pascal/archive/master.zip -o HashLib4Pascal.zip
-  - curl -L -k https://github.com/Xor-el/SimpleBaseLib4Pascal/archive/master.zip -o SimpleBaseLib4Pascal.zip
-  - curl -L -k https://github.com/Xor-el/generics.collections/archive/master.zip -o generics.collections.zip
-  - unzip HashLib4Pascal.zip
-  - unzip SimpleBaseLib4Pascal.zip
-  - unzip generics.collections.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 --add-package-link ./generics.collections-master/generics_collections.lpk  # Add generics.collections 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 ./generics.collections-master/generics_collections.lpk  # Build generics.collections 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 --progress # Run CryptoLib4Pascal TestSuite with timeout of 120 mins
- # - travis_wait 120 $LAZ_ENV ./CryptoLib.Tests/FreePascal.Tests/bin/CryptoLib --format=plain --suite=TTestMD5HMac --progress  # Run TTestMD5HMac TestSuite with timeout of 120 mins
-
-
-notifications:
-  email:
-    on_success: false
-    on_failure: change

+ 1 - 1
CryptoLib.Tests/FreePascal.Tests/CryptoLibConsole.lpr

@@ -41,7 +41,7 @@ uses
   SHA512HMacTests,
   RIPEMD128HMacTests,
   RIPEMD160HMacTests,
- // HMacTests, stalling on x64 windows on travis ci
+  HMacTests,
   Pkcs5Tests,
   HkdfGeneratorTests,
   ECIESTests,

+ 6 - 9
CryptoLib/src/Packages/FPC/CryptoLib4PascalPackage.lpk

@@ -1105,23 +1105,20 @@ Thanks to Sphere 10 Software (http://www.sphere10.com/) for sponsoring the devel
         <UnitName Value="ClpIECC"/>
       </Item269>
     </Files>
-    <RequiredPkgs Count="4">
+    <RequiredPkgs Count="3">
       <Item1>
-        <PackageName Value="generics_collections"/>
-      </Item1>
-      <Item2>
         <PackageName Value="HashLib4PascalPackage"/>
         <MaxVersion Major="2" Minor="4"/>
         <MinVersion Major="2" Minor="5" Valid="True"/>
-      </Item2>
-      <Item3>
+      </Item1>
+      <Item2>
         <PackageName Value="SimpleBaseLib4PascalPackage"/>
         <MaxVersion Major="1" Minor="2"/>
         <MinVersion Major="1" Minor="4" Valid="True"/>
-      </Item3>
-      <Item4>
+      </Item2>
+      <Item3>
         <PackageName Value="FCL"/>
-      </Item4>
+      </Item3>
     </RequiredPkgs>
     <UsageOptions>
       <UnitPath Value="$(PkgOutDir)"/>