# Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils toolchain-funcs #note from ebuild writer: following line is used for rendering metadata.xml #LONG_DESCRIPTION="The flat assembler is a fast and efficient self-assembling 80x86 assembler for DOS, Windows and Linux operating systems. Currently it supports all 8086-80486/Pentium instructions with MMX, SSE, SSE2, SSE3 and 3DNow! extensions, can produce output in binary, MZ, PE, COFF or ELF format. It includes the powerful but easy to use macroinstruction support and does multiple passes to optimize the instruction codes for size. The flat assembler is self-compilable and the full source code is included." DESCRIPTION="The flat assembler is a fast and efficient self-assembling multi-platform 80x86 assembler." HOMEPAGE="http://flatassembler.net" SRC_URI="http://flatassembler.net/fasm-${PV}.tgz" #SRC_URI="http://zeus/fasm/fasm64/fasm-${PV}.tgz" LICENSE="fasm" #KEYWORDS="~x86 ~amd64" KEYWORDS="x86 amd64" SLOT="0" #IUSE="rebuild no_usr_bin" IUSE="no_usr_bin" #Well, here's an (brief) explanation of the USE I use... (pun intended, you may not laught ;) # IUSE # rebuild - force rebuild # no_usr_bin - don't add a symlink in /usr/bin/fasm -> /opt/fasm/fasm #DEPEND="rebuild? ( >=dev-lang/fasm-1.57 )" DEPEND=">=dev-lang/fasm-1.57" S=${WORKDIR} #pkg_setup() { # ewarn "This is a beta version of fasm 1.60." # ewarn "You need t least fasm 1.57 to install this!" #} src_unpack() { unpack ${A} # unzip -LL -d ${WORKDIR} ${DISTDIR}/${A} if use amd64 || use ~amd64 ; then einfo "Notice: You'll need IA32 eumlation support since fasm will be a 32-bit app." fi } src_compile() { # build fasm: einfo "Building fasm..." echo -n "fasm..." fasm ${S}/fasm/source/Linux/fasm.asm ${S}/fasm/fasm > .tmp if [ `echo $?` != "0" ] ; then cat .tmp die Compile! fi echo -e "\bdone!" echo "Build log:" ; cat .tmp ; rm .tmp } src_install() { #${D} = virutal / dodir /opt/fasm mv ${S}/fasm/* ${D}opt/fasm/ # adjust permissions. find ${D}opt/fasm \( -iname '*.txt' -or -iname '*.asm' -or -iname '*.inc' -or -iname '*.o' \) -exec chmod 774 {} \; chmod 775 ${D}opt/fasm/fasm ${D}opt/fasm/examples/elfexe/hello find ${D}opt/fasm -type d -exec chmod 775 {} \; #@gen2 devs: it this "legal" for ebuilds? (ie is there anyway to make it do the symlink like: ln -s ${WILL_BE_MY_ROOT}/opt/fasm ${D}usr/bin/fasm). dodir /usr/bin if use !no_usr_bin ; then ln -s /opt/fasm/fasm ${D}usr/bin/fasm fi }