diff options
-rw-r--r-- | LICENSE | 339 | ||||
-rw-r--r-- | README.txt | 71 | ||||
-rw-r--r-- | app-admin/eselect-dlang/Manifest | 2 | ||||
-rw-r--r-- | app-admin/eselect-dlang/eselect-dlang-20131117.ebuild | 21 | ||||
-rw-r--r-- | app-admin/eselect-dlang/files/dlang.eselect-20131117 | 316 | ||||
-rw-r--r-- | dev-lang/dmd/Manifest | 6 | ||||
-rw-r--r-- | dev-lang/dmd/dmd-2.063.2.ebuild | 168 | ||||
-rw-r--r-- | dev-lang/dmd/dmd-2.064.2.ebuild | 154 | ||||
-rw-r--r-- | dev-lang/dmd/files/2.064-makefile-multilib.patch | 26 | ||||
-rw-r--r-- | dev-lang/dmd/files/LICENSE_1_0.txt | 23 | ||||
-rw-r--r-- | dev-lang/ldc2/Manifest | 3 | ||||
-rw-r--r-- | dev-lang/ldc2/files/0.12.0-_d_newclass.patch | 87 | ||||
-rw-r--r-- | dev-lang/ldc2/ldc2-0.12.0.ebuild | 45 | ||||
-rw-r--r-- | dev-libs/GtkD/GtkD-2.3.0.ebuild | 69 | ||||
-rw-r--r-- | dev-libs/GtkD/Manifest | 3 | ||||
-rw-r--r-- | dev-libs/GtkD/files/2.3.0-makefile.patch | 127 | ||||
-rw-r--r-- | eclass/dlang.eclass | 331 | ||||
-rw-r--r-- | metadata/layout.conf | 1 | ||||
-rw-r--r-- | profiles/repo_name | 1 | ||||
-rw-r--r-- | sys-devel/gcc/Manifest | 7 | ||||
-rw-r--r-- | sys-devel/gcc/gcc-4.8.1.ebuild | 89 |
21 files changed, 1889 insertions, 0 deletions
@@ -0,0 +1,339 @@ +GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., <http://fsf.org/> + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + {description} + Copyright (C) {year} {fullname} + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + {signature of Ty Coon}, 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/README.txt b/README.txt new file mode 100644 index 0000000..eff4000 --- /dev/null +++ b/README.txt @@ -0,0 +1,71 @@ +dlang - overlay for Gentoo Linux +================================ + +This overlay aims to make parallel installation of D compilers easy and offer +some of the most popular D libraries. + +### Executables paths +* DMD: `/opt/dmd-<version>/bin/dmd` +* GDC: `/usr/<abi>-pc-linux-gnu/gcc-bin/<version>/gdc` +* LDC: `/opt/ldc2-<version>/bin/ldc2` + +An eselect script will create symlinks to these executables, so they can be +called by their original names with the exception of GDC which is managed by +gcc-config. + +### Configuration files +For DMD the configuration files lie side-by-side with the executable, to allow +different path setups for each installation. + +### Imports +* DMD: `/opt/dmd-<version>/import` +* GDC: `/usr/include/d/<version>` +* LDC: `/opt/ldc2-<version>/include/d` + +### Libraries +Dynamic and static libraries are installed into: +* DMD: `/opt/dmd-<version>/lib{32,64}` +* GDC: `/usr/lib/gcc/<abi>-pc-linux-gnu/<version>[/32]` +* LDC: `/opt/ldc2-<version>/lib{32,64}` + +Include files should be placed in `/usr/include/dlang/<library>` + +### Procedures +#### When adding new compiler versions +Add the version to dlang.eclass, too. This is way it knows which compiler +release includes which version of D, which is crucial for dependency +management. +#### When changing paths in compiler ebuilds +Make sure that dlang.eselect knows about it. dlang.eclass also has a +function that needs to be changed: `dlang_foreach_config()` +It advertizes compiler specific variables and paths to D ebuilds. + +### Q & A + Q: Why are D libraries not installed in their default locations? + A: D compilers have ABIs that are incompatible with each other. This means + either sticking to one compiler for anything D, or to change the default + location and allow for one installation per compiler. + Since my motivation was to use dmd for debug builds and one of the others + for releases, I chose the second option. I could have just added prefixes + or suffixes to the library names, but that means build scripts + need to be aware of this change. Giving each compiler eco system its own + library directory and seting up the path in the compiler should ideally + allow us to build a D program with any compiler and link to libraries with + no further configuration change. + + Q: So why is there a library directory for each version of each D compiler? + A: It might seem overkill at first, but we have no guarantee about D ABI + stability at this point. Libraries compiled with 2.064 might not work with + libraries compiled with 2.065. To be on the safe side, I decided to + separate D specifications the same way as compilers. + +### TODO +* Optional: Execute eselect dlang upon compiler installation/uninstall. +* Optional: For GtkD, make HTML DDOC generation work with any compiler and + install them if the doc use flag is set. +* Optional: Make dmd respect CFLAGS etc. +* For GtkD, fix the pkg-config (.pc) script to point to the correct library dir + or none (since it should be found in the default paths). + Big question: What to do with the dmd specific "-L" prefixes? +* What to do about rdmd and co.? Their man pages are in the 'dmd' repository, + but the source code is in 'tools'.
\ No newline at end of file diff --git a/app-admin/eselect-dlang/Manifest b/app-admin/eselect-dlang/Manifest new file mode 100644 index 0000000..eaf77db --- /dev/null +++ b/app-admin/eselect-dlang/Manifest @@ -0,0 +1,2 @@ +AUX dlang.eselect-20131117 7156 SHA256 dc8e852c05cbf924d53ddf7f231939ac9ff2da1af3be7cde4174da8893860113 SHA512 bc79f0ac64d3a04522a203ff341d8bcd51d0fb5a70da8aafb1f0a15a8cd28e72d9d0bd95d2fc826359b041fc1854d82b6333d282bc2668325c4e63b824b536be WHIRLPOOL 21635d13a256c239d12b94850b13d31b7b773d8bf91bd3fec68fa328ba2f67b7907954c7d1259b4f2f223b7978413dad0a337fabd11d7aca438dd56603874fab +EBUILD eselect-dlang-20131117.ebuild 393 SHA256 e0d873c751bf3422f1f8cd0887d1ff22ca44c02b45a9ca4f933085526041a226 SHA512 2cb0e4b9d4210fe09df8019e40e2ef19eb00966b8d3b976f20f6568fbd2892ca498c20a9e804fc39fbd05d930324b4862963032483a8e43a9036e02e8b54d86f WHIRLPOOL ab9cacb614e3f134f83277a0295a54c4473da931c4827f85da1559c8843aeb123024fd8234e8bedb09fc28d332db51ef3ab9602f24b73db80d2d9458969ca0e3 diff --git a/app-admin/eselect-dlang/eselect-dlang-20131117.ebuild b/app-admin/eselect-dlang/eselect-dlang-20131117.ebuild new file mode 100644 index 0000000..e631f69 --- /dev/null +++ b/app-admin/eselect-dlang/eselect-dlang-20131117.ebuild @@ -0,0 +1,21 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=5 + +DESCRIPTION="Eselect module for management of multiple D versions" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="" + +RDEPEND="app-admin/eselect" +DEPEND="" + +S="${FILESDIR}" + +src_install() { + insinto /usr/share/eselect/modules + newins dlang.eselect-${PV} dlang.eselect +} diff --git a/app-admin/eselect-dlang/files/dlang.eselect-20131117 b/app-admin/eselect-dlang/files/dlang.eselect-20131117 new file mode 100644 index 0000000..66a41f8 --- /dev/null +++ b/app-admin/eselect-dlang/files/dlang.eselect-20131117 @@ -0,0 +1,316 @@ +# -*-eselect-*- vim: ft=eselect +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +DESCRIPTION="Manage D symlinks" +MAINTAINER="marco.leise@gmx.de" +VERSION="20131110" + +ETC_PATH="${EROOT%/}/etc" +COMPILER_PATH="${EROOT%/}/usr/bin" +MAN1_PATH="${EROOT%/}/usr/share/man/man1" +MAN5_PATH="${EROOT%/}/usr/share/man/man5" + +COMPILERS_VERSION=0 +COMPILERS_VENDOR="" + +# Find a list of D versions +find_targets() { + local verRegex="(0|[1-9][0-9]*)(\.(0|[1-9][0-9]*))+" + local regex + + if [[ "${COMPILERS_VENDOR}" == "dmd" ]]; then + # DMD + regex="/opt/dmd-(0\.[1-9][0-9]{1,2}|[12]\.[0-9]{3})" + find "/opt" -maxdepth 1 -regextype posix-extended -regex "${regex}" -perm "-o+rx" -printf "%f\n" | sort + elif [[ $COMPILERS_VERSION -eq 1 ]]; then + # LDC + regex="/opt/ldc-${verRegex}" + find "/opt" -maxdepth 1 -regextype posix-extended -regex "${regex}" -type d -printf "%f\n" | sort + else + # LDC2 + regex="/opt/ldc2-${verRegex}" + find "/opt" -maxdepth 1 -regextype posix-extended -regex "${regex}" -type d -printf "%f\n" | sort + fi +} + +symlink_helper() { + ln -nfs "${1}" "${2}" || die "Couldn't symlink '${1}' as '${2}'!" +} + +# Set appropriate symlinks +set_compiler() { + local target="${1}" targets=($(find_targets)) x + if is_number "${target}" && [[ ${target} -ge 1 ]]; then + target=${targets[$((${target} - 1))]} + fi + + if ! has ${target} "${targets[@]}"; then + die -q "Invalid target ${target}" + fi + + if [[ "${COMPILERS_VENDOR}" == "dmd" ]]; then + symlink_helper "/opt/${target}/bin/dmd" "${COMPILER_PATH}/dmd" + symlink_helper "/opt/${target}/bin/dmd.conf" "${ETC_PATH}/dmd.conf" + [[ -d ${MAN1_PATH} ]] && symlink_helper "/opt/${target}/man/man1/dmd.1" "${MAN1_PATH}/dmd.1" + [[ -d ${MAN5_PATH} ]] && symlink_helper "/opt/${target}/man/man5/dmd.conf.5" "${MAN5_PATH}/dmd.conf.5" + elif [[ $COMPILERS_VERSION -eq 1 ]]; then + symlink_helper "/opt/${target}/bin/ldc" "${COMPILER_PATH}/ldc" + else + symlink_helper "/opt/${target}/bin/ldc2" "${COMPILER_PATH}/ldc2" + fi +} + +### show action ### + +describe_show() { + echo "Show active D compiler by vendor" +} + +describe_show_options() { + echo "dmd : Show active Digital Mars D compiler" + echo "ldc : Show active LLVM D1 compiler" + echo "ldc2 : Show active LLVM D2 compiler" +} + +do_show() { + local dmd=0 ldc=0 ldc2=0 + while [[ $# > 0 ]]; do + case "$1" in + dmd) + dmd=1 + ;; + ldc) + ldc=1 + ;; + ldc2) + ldc2=1 + ;; + *) + die -q "Unrecognized argument '$1'" + ;; + esac + shift + done + + if [[ $(( $dmd+$ldc+$ldc2 )) -ne 1 ]]; then + die -q "Exactly one of 'dmd', 'ldc' or 'ldc2' must be specified" + fi + + if [[ $dmd -eq 1 ]]; then + interpreter="$(readlink "${COMPILER_PATH}/dmd" | sed "s#^/opt/##;s#/bin/dmd\$##")" + elif [[ $ldc -eq 1 ]]; then + interpreter="$(readlink "${COMPILER_PATH}/ldc" | sed "s#^/opt/##;s#/bin/ldc\$##")" + elif [[ $ldc2 -eq 1 ]]; then + interpreter="$(readlink "${COMPILER_PATH}/ldc2" | sed "s#^/opt/##;s#/bin/ldc2\$##")" + fi + + echo -n "${interpreter}" + + if [[ -n "${interpreter}" ]]; then + echo + fi +} + +### list action ### + +describe_list() { + echo "List installed D compilers by vendor" +} + +describe_list_options() { + echo "dmd : List installed Digital Mars D compiler" + echo "ldc : List installed LLVM D1 compiler" + echo "ldc2 : List installed LLVM D2 compiler" +} + +describe_list_parameters() { + echo "<vendor>" +} + +do_list() { + local dmd=0 ldc=0 ldc2=0 + while [[ $# > 0 ]]; do + case "$1" in + dmd) + dmd="1" + vendor_descriptive_name="Digital Mars D" + vendor_option="$1" + COMPILERS_VERSION=0 + COMPILERS_VENDOR="dmd" + ;; + ldc) + ldc="1" + vendor_descriptive_name="LLVM D1" + vendor_option="$1" + COMPILERS_VERSION=1 + COMPILERS_VENDOR="ldc" + ;; + ldc2) + ldc2="1" + vendor_descriptive_name="LLVM D2" + vendor_option="$1" + COMPILERS_VERSION=2 + COMPILERS_VENDOR="ldc" + ;; + *) + die -q "Unrecognized argument '$1'" + ;; + esac + shift + done + + if [[ $(( $dmd+$ldc+$ldc2 )) -ne 1 ]]; then + die -q "Exactly one of 'dmd', 'ldc' or 'ldc2' must be specified" + fi + + targets=($(find_targets)) + + write_list_start "Available ${vendor_descriptive_name} interpreters:" + + active="$(do_show ${vendor_option})" + for ((i = 0; i < ${#targets[@]}; i++)); do + if [[ ${targets[${i}]} == ${active} ]]; then + targets[${i}]="$(highlight_marker "${targets[${i}]}")" + fi + done + write_numbered_list -m "(none found)" "${targets[@]}" +} + +### set action ### + +describe_set() { + echo "Set active D compiler by vendor" +} + +describe_set_options() { + echo "dmd : Set active Digital Mars D compiler" + echo "ldc : Set active LLVM D1 compiler" + echo "ldc2 : Set active LLVM D2 compiler" +} + +describe_set_parameters() { + echo "<vendor>" +} + +do_set() { + local dmd=0 ldc=0 ldc2=0 + while [[ $# > 0 ]]; do + case "$1" in + dmd) + dmd=1 + COMPILERS_VERSION=0 + COMPILERS_VENDOR="dmd" + ;; + ldc) + ldc=1 + COMPILERS_VERSION=1 + COMPILERS_VENDOR="ldc" + ;; + ldc2) + ldc2=1 + COMPILERS_VERSION=2 + COMPILERS_VENDOR="ldc" + ;; + *) + break + ;; + esac + shift + done + + if [[ $(( $dmd+$ldc+$ldc2 )) -ne 1 ]]; then + die -q "Exactly one of 'dmd', 'ldc' or 'ldc2' must be specified" + fi + + if [[ $# -lt 1 ]]; then + die -q "'eselect dlang set' requires D compiler name" + elif [[ $# -gt 1 ]]; then + die -q "'eselect dlang set' requires 1 argument" + else + if ! set_compiler "${1}"; then + die -q "Can't set new compiler" + fi + fi +} + +### update action ### + +describe_update() { + echo "Switch to the most recent D implementations" +} + +describe_update_options() { + echo "--if-unset : Do not override existing implementation" + echo "dmd : Set active Digital Mars D compiler" + echo "ldc : Set active LLVM D1 compiler" + echo "ldc2 : Set active LLVM D2 compiler" +} + +do_update() { + local if_unset=0 dmd=0 ldc=0 ldc2=0 targets + while [[ $# > 0 ]]; do + case "$1" in + --if-unset) + if_unset=1 + ;; + dmd) + dmd=1 + ;; + ldc) + ldc=1 + ;; + ldc2) + ldc2=1 + ;; + *) + break + ;; + esac + shift + done + + # No vendor name given means all + if [[ $(( $dmd+$ldc+$ldc2 )) -eq 0 ]]; then + dmd=1 + ldc=1 + ldc2=1 + fi + + if [[ $dmd -eq 1 ]]; then + if [[ $if_unset -eq 0 ]] || [[ -z "$(do_show dmd)" ]]; then + COMPILERS_VERSION=0 + COMPILERS_VENDOR="dmd" + targets=($(find_targets)) + if [[ ${#targets[@]} -eq 0 ]]; then + echo "No dmd installed, skipping." + else + do_set dmd "${targets[${#targets[@]}-1]}" + fi + fi + fi + if [[ $ldc -eq 1 ]]; then + if [[ $if_unset -eq 0 ]] || [[ -z "$(do_show ldc)" ]]; then + COMPILERS_VERSION=1 + COMPILERS_VENDOR="ldc" + targets=($(find_targets)) + if [[ ${#targets[@]} -eq 0 ]]; then + echo "No ldc installed, skipping." + else + do_set ldc "${targets[${#targets[@]}-1]}" + fi + fi + fi + if [[ $ldc2 -eq 1 ]]; then + if [[ $if_unset -eq 0 ]] || [[ -z "$(do_show ldc2)" ]]; then + COMPILERS_VERSION=2 + COMPILERS_VENDOR="ldc" + targets=($(find_targets)) + if [[ ${#targets[@]} -eq 0 ]]; then + echo "No ldc2 installed, skipping." + else + do_set ldc2 "${targets[${#targets[@]}-1]}" + fi + fi + fi +} diff --git a/dev-lang/dmd/Manifest b/dev-lang/dmd/Manifest new file mode 100644 index 0000000..e94150c --- /dev/null +++ b/dev-lang/dmd/Manifest @@ -0,0 +1,6 @@ +AUX 2.064-makefile-multilib.patch 868 SHA256 aead2163f4519e7c07a3c62af722d44b1c526c5be27001b1ff998ce86a8d6367 SHA512 69f0304ec3dd6a935bf80cf061ed8ee8c862ab472d0b951da14ddf6a263481f4e421d3880d9b931e13449840770453f0c9e804b17c38101e945de78a32f852ad WHIRLPOOL aeda03a85ae31ab9cd36e891ba04c277dc451b46be311e902cbde1e75dce73dc02b1cb6743164c8225a5360dca30b67b5399c88099d316772e2cbad1e3546b68 +AUX LICENSE_1_0.txt 1338 SHA256 c9bff75738922193e67fa726fa225535870d2aa1059f91452c411736284ad566 SHA512 d6078467835dba8932314c1c1e945569a64b065474d7aced27c9a7acc391d52e9f234138ed9f1aa9cd576f25f12f557e0b733c14891d42c16ecdc4a7bd4d60b8 WHIRLPOOL a93fefbd6948d5c4da72d2b266d50e546f0a3b506c7ddcf865b04e4a5d1a942a102ce892c34fbf12457b882e8e2cc55bab9c0a7114b9bda965c592f5b02d4963 +DIST dmd.2.063.2.zip 33144090 SHA256 ddb8fc86377fbfc15509801664ecbbc66fd6386ff5c0f415c2b9993add1bea75 SHA512 8b7a0b308a92e7adbccb05a7e2ec87e287f66ba42e9f856e19aae78127b13c50bad5cb56dd79f49d3237248fd3fe0f430bdef012dda1f38ab875a664c43308ae WHIRLPOOL 1a4b649628a6d627e8ae84bf1acbc3151635ffcf3d0a6552b30f620abb20504d425f0eda9f27126e4488cc0627278a7f86adbffef1af2e452d73d2456eb0efcb +DIST dmd.2.064.2.zip 33349115 SHA256 f51a10a137e0be6fb8ef32e3ff475aa377af1461400ec2cef2dcb917976f12c4 SHA512 4ec199c86c717273cf7c3c256ce56bc7144a453d3030a62de2c7e435e52ee5d2414c7bd9bb7c643b4734897e9621a31dff7b7fe3742f5b5785cb1e5eafb1bede WHIRLPOOL 688d98990b6558b3f1bdb0644ccf391d4a08526767427e7d99683473409a2821f2e5a04859b2b10767d4c7b9156a28ffc89a89348ba71b32420925a0e6c4e765 +EBUILD dmd-2.063.2.ebuild 4930 SHA256 2579e7bbb29af06e1231814df7b3ad77de470e0043a9ee76ff8fc0796e363a3d SHA512 90860aa74382d117bf72758ce3817fd5c8a6992a586c184710460caa66b5515e0fa9256a40b843b401a0e0ceaf1363c4c2f22f848558aa8f6d0b20518dc2c89f WHIRLPOOL 8a00ef67369a53626faf17f05b657cdb2e1e4f6c873ee1f63b9e3adc6c1e1628a06d33ddce1595896583579b8776cedd56273192ff13d399296489688e18198a +EBUILD dmd-2.064.2.ebuild 4682 SHA256 910ef553227a3735d3a0736c216474ac661efe1c6586f91961a2998b504902fd SHA512 4c851fbd513b1bd58b1cb70ed68a1d90ceebd973b8cfcc7fcf8fb3c79ec0c896e61fd619b9e3947bf91994e184bc01ae85eed6cf3eb6cae6f3de194397c4f80d WHIRLPOOL da9b23be9e20f0fc165fc5c0283dfd46048fff77d90082c0e64e4bd5f20ab2e5b128c9fe383ccdc6c92c72018e54902a5d09eec6e0353f31f37a02de5632bc93 diff --git a/dev-lang/dmd/dmd-2.063.2.ebuild b/dev-lang/dmd/dmd-2.063.2.ebuild new file mode 100644 index 0000000..97e34a0 --- /dev/null +++ b/dev-lang/dmd/dmd-2.063.2.ebuild @@ -0,0 +1,168 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI="5" + +inherit eutils multilib-build + +DESCRIPTION="Reference compiler for the D programming language" +HOMEPAGE="http://dlang.org/" +SRC_URI="http://downloads.dlang.org.s3.amazonaws.com/releases/2013/${PN}.${PV}.zip" + +# DMD supports amd64/x86 exclusively +KEYWORDS="amd64 x86" +SLOT="2.063" +IUSE="doc examples" + +# License doesn't allow redistribution +LICENSE="DMD" +RESTRICT="mirror" + +DEPEND=" + app-arch/unzip + app-admin/eselect-dlang + " +RDEPEND="!dev-lang/dmd-bin" + +S="${WORKDIR}/dmd2" + +PREFIX="opt/${PN}-${SLOT}" +IMPORT_DIR="/${PREFIX}/import" + +src_prepare() { + # Remove precompiled binaries and non-essential files. + rm -r README.TXT windows osx linux || die "Failed to remove included binaries." + + # convert line-endings of file-types that start as cr-lf and are patched or installed later on + for file in $( find . -name "*.txt" -o -name "*.html" -o -name "*.d" -o -name "*.di" -o -name "*.ddoc" -type f ); do + edos2unix $file || die "Failed to convert DOS line-endings to Unix." + done + + # patch: copy VERSION file into dmd directory + cp src/VERSION src/dmd/VERSION || die "Failed to copy VERSION file into dmd directory." + + # Rename man pages to reflect slot number. + mkdir man/man5 || die "Failed to create man/man5." + mv man/man1/dmd.conf.5 man/man5/dmd.conf.5 + + # Write a simple dmd.conf to bootstrap druntime and phobos + cat > src/dmd/dmd.conf << EOF +[Environment] +DFLAGS=-L--export-dynamic +EOF + + # Copy missing LICENSE_1_0.txt + cp "${FILESDIR}/LICENSE_1_0.txt" src/phobos/ || die "Couldn't copy LICENSE_1_0.txt" +} + +abi_to_model() { + [[ "${ABI:0:5}" == "amd64" ]] && echo 64 || echo 32 +} + +dmd_foreach_abi() { + for ABI in $(multilib_get_enabled_abis); do + local MODEL=$(abi_to_model) + einfo "Executing ${1} in ${MODEL}-bit ..." + "${@}" + done +} + +src_compile() { + # A native build of dmd is used to compile the runtimes for both x86 and amd64 + # We cannot use multilib-minimal yet, as we have to be sure dmd for amd64 + # always gets build first. + einfo "Building ${PN}..." + emake -C src/dmd -f posix.mak TARGET_CPU=X86 RELEASE=1 + + compile_libraries() { + einfo 'Building druntime...' + emake -C src/druntime -f posix.mak MODEL=${MODEL} DMD=../dmd/dmd + + einfo 'Building Phobos 2...' + emake -C src/phobos -f posix.mak MODEL=${MODEL} DMD=../dmd/dmd + } + + dmd_foreach_abi compile_libraries +} + +src_test() { + test_hello_world() { + src/dmd/dmd -m${MODEL} -Isrc/phobos -Isrc/druntime/import -L-Lsrc/phobos/generated/linux/release/${MODEL} samples/d/hello.d || die "Failed to build hello.d (${MODEL}-bit)" + ./hello ${MODEL}-bit || die "Failed to run test sample (${MODEL}-bit)" + rm hello.o hello + } + + dmd_foreach_abi test_hello_world +} + +src_install() { + # Prepeare and install config file. + if has_multilib_profile; then + cat > src/dmd/dmd.conf.default << EOF +[Environment32] +DFLAGS=-I${IMPORT_DIR} -L-L/${PREFIX}/lib32 -L-rpath -L/${PREFIX}/lib32 -L--export-dynamic +[Environment64] +DFLAGS=-I${IMPORT_DIR} -L-L/${PREFIX}/lib64 -L-rpath -L/${PREFIX}/lib64 -L--export-dynamic +EOF + else + cat > src/dmd/dmd.conf.default << EOF +[Environment] +DFLAGS=-I${IMPORT_DIR} -L-L/${PREFIX}/lib -L-rpath -L/${PREFIX}/lib -L--export-dynamic +EOF + fi + einfo "Installing ${PN}..." + into ${PREFIX} + dobin src/dmd/dmd + insinto ${PREFIX}/bin + newins src/dmd/dmd.conf.default dmd.conf + insinto ${PREFIX} + newins src/dmd/backendlicense.txt dmd-backendlicense.txt + newins src/dmd/artistic.txt dmd-artistic.txt + + einfo 'Installing druntime...' + install_druntime() { + into ${PREFIX} + dolib.a src/druntime/lib/libdruntime-linux${MODEL}.a + dolib.a src/druntime/lib/libdruntime-linux${MODEL}so.a + dolib src/druntime/lib/libdruntime-linux${MODEL}so.o + } + dmd_foreach_abi install_druntime + newins src/druntime/LICENSE druntime-LICENSE.txt + insinto ${PREFIX}/import + doins -r src/druntime/import/* + + einfo 'Installing Phobos 2...' + install_library() { + into ${PREFIX} + dolib.a src/phobos/generated/linux/release/${MODEL}/libphobos2.a + dolib.so src/phobos/generated/linux/release/${MODEL}/libphobos2.so.0.2.0 + dosym libphobos2.so.0.2.0 ${PREFIX}/$(get_libdir)/libphobos2.so.0.2 + dosym libphobos2.so.0.2.0 ${PREFIX}/$(get_libdir)/libphobos2.so + } + dmd_foreach_abi install_library + insinto ${PREFIX}/import + doins -r src/phobos/std + doins -r src/phobos/etc + doins src/phobos/crc32.d + insinto ${PREFIX} + newins src/phobos/LICENSE_1_0.txt phobos-LICENSE.txt + + # man pages, docs and samples + insinto ${PREFIX}/man/man1 + doins man/man1/dmd.1 + insinto ${PREFIX}/man/man5 + doins man/man5/dmd.conf.5 + insinto ${PREFIX} + use doc && doins -r html + if use examples; then + docompress -x ${PREFIX}/samples/ + insinto ${PREFIX}/samples + doins -r samples/d/* + fi +} + +pkg_postinst() { + elog "License files are in: /${PREFIX}" + use examples && elog "Examples can be found in: /${PREFIX}/samples" + use doc && elog "HTML documentation is in: /${PREFIX}/html" +} diff --git a/dev-lang/dmd/dmd-2.064.2.ebuild b/dev-lang/dmd/dmd-2.064.2.ebuild new file mode 100644 index 0000000..157b0fa --- /dev/null +++ b/dev-lang/dmd/dmd-2.064.2.ebuild @@ -0,0 +1,154 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI="5" + +inherit eutils multilib-build + +DESCRIPTION="Reference compiler for the D programming language" +HOMEPAGE="http://dlang.org/" +SRC_URI="http://downloads.dlang.org.s3.amazonaws.com/releases/2013/${PN}.${PV}.zip" + +# DMD supports amd64/x86 exclusively +KEYWORDS="amd64 x86" +SLOT="2.064" +IUSE="doc examples" + +# License doesn't allow redistribution +LICENSE="DMD" +RESTRICT="mirror" + +DEPEND=" + app-arch/unzip + app-admin/eselect-dlang + " +RDEPEND="!dev-lang/dmd-bin" + +S="${WORKDIR}/dmd2" + +PREFIX="opt/${PN}-${SLOT}" +IMPORT_DIR="/${PREFIX}/import" + +src_prepare() { + # Remove precompiled binaries and non-essential files. + rm -r README.TXT windows osx linux || die "Failed to remove included binaries." + + # convert line-endings of file-types that start as cr-lf and are patched or installed later on + for file in $( find . -name "*.txt" -o -name "*.html" -o -name "*.d" -o -name "*.di" -o -name "*.ddoc" -type f ); do + edos2unix $file || die "Failed to convert DOS line-endings to Unix." + done + + # patch: copy VERSION file into dmd directory + cp src/VERSION src/dmd/VERSION || die "Failed to copy VERSION file into dmd directory." + + # Rename man pages to reflect slot number. + mkdir man/man5 || die "Failed to create man/man5." + mv man/man1/dmd.conf.5 man/man5/dmd.conf.5 + + # Write a simple dmd.conf to bootstrap druntime and phobos + cat > src/dmd/dmd.conf << EOF +[Environment] +DFLAGS=-L--export-dynamic +EOF + + # Copy missing LICENSE_1_0.txt + cp "${FILESDIR}/LICENSE_1_0.txt" src/phobos/ || die "Couldn't copy LICENSE_1_0.txt" + + # Allow installation into lib32/lib64 + epatch "${FILESDIR}/${SLOT}-makefile-multilib.patch" +} + +abi_to_model() { + [[ "${ABI:0:5}" == "amd64" ]] && echo 64 || echo 32 +} + +dmd_foreach_abi() { + for ABI in $(multilib_get_enabled_abis); do + local MODEL=$(abi_to_model) + einfo "Executing ${1} in ${MODEL}-bit ..." + "${@}" + done +} + +src_compile() { + # A native build of dmd is used to compile the runtimes for both x86 and amd64 + # We cannot use multilib-minimal yet, as we have to be sure dmd for amd64 + # always gets build first. + einfo "Building ${PN}..." + emake -C src/dmd -f posix.mak TARGET_CPU=X86 RELEASE=1 + + compile_libraries() { + einfo 'Building druntime...' + emake -C src/druntime -f posix.mak MODEL=${MODEL} DMD=../dmd/dmd + + einfo 'Building Phobos 2...' + emake -C src/phobos -f posix.mak MODEL=${MODEL} DMD=../dmd/dmd + } + + dmd_foreach_abi compile_libraries +} + +src_test() { + test_hello_world() { + src/dmd/dmd -m${MODEL} -Isrc/phobos -Isrc/druntime/import -L-Lsrc/phobos/generated/linux/release/${MODEL} samples/d/hello.d || die "Failed to build hello.d (${MODEL}-bit)" + ./hello ${MODEL}-bit || die "Failed to run test sample (${MODEL}-bit)" + rm hello.o hello + } + + dmd_foreach_abi test_hello_world +} + +src_install() { + # Prepeare and install config file. + if has_multilib_profile; then + cat > src/dmd/dmd.conf.default << EOF +[Environment32] +DFLAGS=-I${IMPORT_DIR} -L-L/${PREFIX}/lib32 -L-rpath -L/${PREFIX}/lib32 -L--export-dynamic +[Environment64] +DFLAGS=-I${IMPORT_DIR} -L-L/${PREFIX}/lib64 -L-rpath -L/${PREFIX}/lib64 -L--export-dynamic +EOF + else + cat > src/dmd/dmd.conf.default << EOF +[Environment] +DFLAGS=-I${IMPORT_DIR} -L-L/${PREFIX}/lib -L-rpath -L/${PREFIX}/lib -L--export-dynamic +EOF + fi + einfo "Installing ${PN}..." + emake -C src/dmd -f posix.mak TARGET_CPU=X86 RELEASE=1 INSTALL_DIR="${D}${PREFIX}" install + + einfo 'Installing druntime...' + install_druntime() { + emake -C src/druntime -f posix.mak INSTALL_DIR="${D}${PREFIX}" LIB_DIR="$(get_libdir)" MODEL=$(abi_to_model) install + rm -r "${D}${PREFIX}/html" || die "Couldn't remove duplicate HTML documentation." + } + dmd_foreach_abi install_druntime + + einfo 'Installing Phobos 2...' + into ${PREFIX} + install_library() { + emake -C src/phobos -f posix.mak INSTALL_DIR="${D}${PREFIX}" LIB_DIR="$(get_libdir)" MODEL=$(abi_to_model) install + dolib.so src/phobos/generated/linux/release/${MODEL}/libphobos2.so.0.64.0 + dosym libphobos2.so.0.64.0 ${PREFIX}/$(get_libdir)/libphobos2.so.0.64 + dosym libphobos2.so.0.64.0 ${PREFIX}/$(get_libdir)/libphobos2.so + } + dmd_foreach_abi install_library + + # man pages, docs and samples + insinto ${PREFIX}/man/man1 + doins man/man1/dmd.1 + insinto ${PREFIX}/man/man5 + doins man/man5/dmd.conf.5 + insinto ${PREFIX} + use doc && doins -r html + if use examples; then + docompress -x ${PREFIX}/samples/ + insinto ${PREFIX}/samples + doins -r samples/d/* + fi +} + +pkg_postinst() { + elog "License files are in: /${PREFIX}" + use examples && elog "Examples can be found in: /${PREFIX}/samples" + use doc && elog "HTML documentation is in: /${PREFIX}/html" +} diff --git a/dev-lang/dmd/files/2.064-makefile-multilib.patch b/dev-lang/dmd/files/2.064-makefile-multilib.patch new file mode 100644 index 0000000..c03de05 --- /dev/null +++ b/dev-lang/dmd/files/2.064-makefile-multilib.patch @@ -0,0 +1,26 @@ +--- src/druntime/posix.mak ++++ src/druntime/posix.mak +@@ -237,8 +237,8 @@ + cp -r doc/* $(INSTALL_DIR)/html/ + mkdir -p $(INSTALL_DIR)/import + cp -r import/* $(INSTALL_DIR)/import/ +- mkdir -p $(INSTALL_DIR)/lib +- cp -r lib/* $(INSTALL_DIR)/lib/ ++ mkdir -p $(INSTALL_DIR)/$(LIB_DIR) ++ cp -r lib/libdruntime-linux$(MODEL)* $(INSTALL_DIR)/$(LIB_DIR)/ + cp LICENSE $(INSTALL_DIR)/druntime-LICENSE.txt + + clean: $(addsuffix /.clean,$(ADDITIONAL_TESTS)) +--- src/phobos/posix.mak ++++ src/phobos/posix.mak +@@ -331,8 +331,8 @@ + zip $(ZIPFILE) $(MAKEFILE) $(ALL_D_FILES) $(ALL_C_FILES) win32.mak win64.mak + + install2 : release +- mkdir -p $(INSTALL_DIR)/lib +- cp $(LIB) $(INSTALL_DIR)/lib/ ++ mkdir -p $(INSTALL_DIR)/$(LIB_DIR) ++ cp $(LIB) $(INSTALL_DIR)/$(LIB_DIR)/ + mkdir -p $(INSTALL_DIR)/import/etc + mkdir -p $(INSTALL_DIR)/import/std + cp crc32.d $(INSTALL_DIR)/import/ diff --git a/dev-lang/dmd/files/LICENSE_1_0.txt b/dev-lang/dmd/files/LICENSE_1_0.txt new file mode 100644 index 0000000..36b7cd9 --- /dev/null +++ b/dev-lang/dmd/files/LICENSE_1_0.txt @@ -0,0 +1,23 @@ +Boost Software License - Version 1.0 - August 17th, 2003 + +Permission is hereby granted, free of charge, to any person or organization +obtaining a copy of the software and accompanying documentation covered by +this license (the "Software") to use, reproduce, display, distribute, +execute, and transmit the Software, and to prepare derivative works of the +Software, and to permit third-parties to whom the Software is furnished to +do so, all subject to the following: + +The copyright notices in the Software and this entire statement, including +the above license grant, this restriction and the following disclaimer, +must be included in all copies of the Software, in whole or in part, and +all derivative works of the Software, unless such copies or derivative +works are solely in the form of machine-executable object code generated by +a source language processor. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT +SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE +FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. diff --git a/dev-lang/ldc2/Manifest b/dev-lang/ldc2/Manifest new file mode 100644 index 0000000..20598bd --- /dev/null +++ b/dev-lang/ldc2/Manifest @@ -0,0 +1,3 @@ +AUX 0.12.0-_d_newclass.patch 3507 SHA256 cf15cb2d8c5ded354a883881ae73ebcc480ede56e35b5acbc6635264a93d3703 SHA512 454890cb132373893a1aeb96b74a425d95f5a36ea93c284577f622e75c104e16080d9d938d746ee23e2d7e07a92b577ebdcc61ad24e788058c400cf9b536d9ef WHIRLPOOL 887592e5f87def117bfe395b755d1c66aea4e0e2b94db4d85d564efa8d343ce9622f8403bea13f82af538f83916871a36340e277d383545f7f12971a3826d618 +DIST ldc-0.12.0-src.tar.gz 3637207 SHA256 52393807717a3aa6429630021b16c62473290a384ab219027d5abcfdde0442f1 SHA512 b1a79b98ef79376cf07edd130ead16a8f0d43d0d30fe489d5cfc7d043e8651b54486b4f29fb4915b811623b7d3bb9b38f3a0ba88f26093f4bf2346892466eda5 WHIRLPOOL 1e0ea020f0cb31512aceac64e3a53594ca70dff902148c7cc83a53ab5594a68d22da403cb32373bb60481839ad6a73fc27a552760ea7a6a8a93f0837b3ac34e7 +EBUILD ldc2-0.12.0.ebuild 910 SHA256 ea610cd4272511cf97741768e5be5739bca78ecf09e0263fbc4d4b5ef1b73842 SHA512 762ba769820c79a037b937f2d4ba7aa29694a33c20b83f5006d179a202a59a0225e26021b2588c94079882fd8e9c5387ec3be092c5f915b402fd46e742541bea WHIRLPOOL 467c9a378bcdb4639bdb963a178c6efc8d9083d23169afaf8ec2ac97d9570faeb88baab2b748a9690531420da6285a8a0cd4c13be7c35829afb091e65612d9d9 diff --git a/dev-lang/ldc2/files/0.12.0-_d_newclass.patch b/dev-lang/ldc2/files/0.12.0-_d_newclass.patch new file mode 100644 index 0000000..3002197 --- /dev/null +++ b/dev-lang/ldc2/files/0.12.0-_d_newclass.patch @@ -0,0 +1,87 @@ +diff --git a/gen/classes.cpp b/gen/classes.cpp +index 2e8e13b..7587409 100644 +--- a/gen/classes.cpp ++++ b/gen/classes.cpp +@@ -106,7 +106,7 @@ DValue* DtoNewClass(Loc loc, TypeClass* tc, NewExp* newexp) + // default allocator + else + { +- llvm::Function* fn = LLVM_D_GetRuntimeFunction(gIR->module, _d_allocclass); ++ llvm::Function* fn = LLVM_D_GetRuntimeFunction(gIR->module, "_d_newclass"); + LLConstant* ci = DtoBitCast(tc->sym->ir.irAggr->getClassInfoSymbol(), DtoType(ClassDeclaration::classinfo->type)); + mem = gIR->CreateCallOrInvoke(fn, ci, ".newclass_gc_alloc").getInstruction(); + mem = DtoBitCast(mem, DtoType(tc), ".newclass_gc"); +diff --git a/gen/passes/GarbageCollect2Stack.cpp b/gen/passes/GarbageCollect2Stack.cpp +index 7b70d67..6d5cb97 100644 +--- a/gen/passes/GarbageCollect2Stack.cpp ++++ b/gen/passes/GarbageCollect2Stack.cpp +@@ -146,6 +146,7 @@ namespace { + : TypeInfoArgNr(typeInfoArgNr), + SafeToDelete(safeToDelete), + ReturnsArray(returnsArray) {} ++ virtual ~FunctionInfo() {} + }; + + class ArrayFI : public FunctionInfo { +@@ -251,7 +252,7 @@ namespace { + } + }; + +- // FunctionInfo for _d_allocclass ++ // FunctionInfo for _d_newclass + class AllocClassFI : public FunctionInfo { + public: + virtual bool analyze(CallSite CS, const Analysis& A) { +@@ -359,7 +360,7 @@ GarbageCollect2Stack::GarbageCollect2Stack() + KnownFunctions["_d_allocmemoryT"] = &AllocMemoryT; + KnownFunctions["_d_newarrayvT"] = &NewArrayVT; + KnownFunctions["_d_newarrayT"] = &NewArrayT; +- KnownFunctions[_d_allocclass] = &AllocClass; ++ KnownFunctions["_d_newclass"] = &AllocClass; + } + + static void RemoveCall(CallSite CS, const Analysis& A) { +diff --git a/gen/passes/SimplifyDRuntimeCalls.cpp b/gen/passes/SimplifyDRuntimeCalls.cpp +index 6747c37..fe0b735 100644 +--- a/gen/passes/SimplifyDRuntimeCalls.cpp ++++ b/gen/passes/SimplifyDRuntimeCalls.cpp +@@ -363,7 +363,7 @@ void SimplifyDRuntimeCalls::InitOptimizations() { + Optimizations["_d_newarraymT"] = &Allocation; + Optimizations["_d_newarraymiT"] = &Allocation; + Optimizations["_d_newarraymvT"] = &Allocation; +- Optimizations[_d_allocclass] = &Allocation; ++ Optimizations["_d_newclass"] = &Allocation; + } + + +diff --git a/gen/runtime.cpp b/gen/runtime.cpp +index e1e65be..60b748f 100644 +--- a/gen/runtime.cpp ++++ b/gen/runtime.cpp +@@ -426,11 +426,11 @@ static void LLVM_D_BuildRuntimeModule() + llvm::Function::Create(fty, llvm::GlobalValue::ExternalLinkage, fname, M); + } + +- // Object _d_allocclass(ClassInfo ci) ++ // Object _d_newclass(const ClassInfo ci) + { +- llvm::StringRef fname(_d_allocclass); ++ llvm::StringRef fname("_d_newclass"); + LLType *types[] = { classInfoTy }; +- LLFunctionType* fty = llvm::FunctionType::get(voidPtrTy, types, false); ++ LLFunctionType* fty = llvm::FunctionType::get(objectTy, types, false); + llvm::Function::Create(fty, llvm::GlobalValue::ExternalLinkage, fname, M) + ->setAttributes(Attr_NoAlias); + } +diff --git a/gen/runtime.h b/gen/runtime.h +index f64e3ae..cd052f8 100644 +--- a/gen/runtime.h ++++ b/gen/runtime.h +@@ -30,7 +30,6 @@ llvm::Function* LLVM_D_GetRuntimeFunction(llvm::Module* target, const char* name + + llvm::GlobalVariable* LLVM_D_GetRuntimeGlobal(llvm::Module* target, const char* name); + +-#define _d_allocclass "_d_newclass" + #define _adEq "_adEq2" + #define _adCmp "_adCmp2" + diff --git a/dev-lang/ldc2/ldc2-0.12.0.ebuild b/dev-lang/ldc2/ldc2-0.12.0.ebuild new file mode 100644 index 0000000..09f435c --- /dev/null +++ b/dev-lang/ldc2/ldc2-0.12.0.ebuild @@ -0,0 +1,45 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ +EAPI=4 + +inherit cmake-utils versionator + +MY_PV=$(replace_version_separator '_' '-') +MY_P="ldc-${MY_PV}-src" +SRC_URI="https://github.com/ldc-developers/ldc/releases/download/v${MY_PV}/${MY_P}.tar.gz" +S=${WORKDIR}/${MY_P} + +DESCRIPTION="LLVM D Compiler" +HOMEPAGE="https://ldc-developers.github.com/ldc" +KEYWORDS="x86 amd64 ~ppc64" +LICENSE="BSD" +SLOT="${PV}" +IUSE="" + +RDEPEND=">=sys-devel/llvm-3.1-r2 + >=dev-libs/libconfig-1.4.7" +DEPEND=">=dev-util/cmake-2.8 + ${RDEPEND}" + +src_prepare() { + epatch "${FILESDIR}/0.12.0-_d_newclass.patch" +} + +src_configure() { + local mycmakeargs=( + -DD_VERSION=2 + -DCMAKE_INSTALL_PREFIX=/opt/ldc2-${PV} + ) + cmake-utils_src_configure +} + +src_compile() { + cmake-utils_src_make +} + +src_install() { + cmake-utils_src_install + + rm -rf "${ED}"/usr/share/bash-completion +}
\ No newline at end of file diff --git a/dev-libs/GtkD/GtkD-2.3.0.ebuild b/dev-libs/GtkD/GtkD-2.3.0.ebuild new file mode 100644 index 0000000..2274302 --- /dev/null +++ b/dev-libs/GtkD/GtkD-2.3.0.ebuild @@ -0,0 +1,69 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=4 + +DESCRIPTION="D binding and OO wrapper of GTK+ and is released on the LGPL license" +HOMEPAGE="http://gtkd.org/" + +SLOT="0" +KEYWORDS="x86 amd64" +DEPEND="app-arch/unzip" +RDEPEND="x11-libs/gtk+:3" + +SRC_URI="http://master.dl.sourceforge.net/project/gtkd-packages/sources/${P}.zip" + +DLANG_VERSION_RANGE="2.063-" + +inherit eutils dlang + +GTKD_COMP_FLAGS=(opengl sourceview libgda gstreamer vte) +GTKD_COMP_NAMES=(gtkdgl sv gda gstreamer vte) +IUSE="${GTKD_COMP_FLAGS[@]} static-libs" + +flags_to_comps() { + comps=("${1}gtkd") + for (( i = 0 ; i < ${#GTKD_COMP_FLAGS[@]} ; i++ )); do + use ${GTKD_COMP_FLAGS[$i]} && comps+=("${1}${GTKD_COMP_NAMES[$i]}") + done + echo ${comps[@]} +} + +src_unpack() { + unzip -q ${DISTDIR}/${A} -d ${S} +} + +src_prepare() { + epatch "${FILESDIR}/${PV}-makefile.patch" + dlang_copy_sources +} + +d_src_compile() { + local components=() + if dlang_has_shared_lib_support; then + components+=($(flags_to_comps shared-)) + else + ewarn "${DLANG_VENDOR} version ${DC_VERSION} does not have shared library support." + ewarn "Only static libraries will be compiled if selected through the static-libs USE flag." + fi + if use static-libs; then + components+=($(flags_to_comps)) + fi + if [[ ${#components[@]} -ne 0 ]]; then + emake ${components} + fi +} + +d_src_install() { + if dlang_has_shared_lib_support; then + emake DESTDIR="${D}" LIBDIR="$(get_libdir)/dlang/dmd-2.064" $(flags_to_comps "install-shared-") + fi + if use static-libs; then + emake DESTDIR="${D}" LIBDIR="$(get_libdir)/dlang/dmd-2.064" $(flags_to_comps "install-") + fi +} + +src_install_all() { + emake DESTDIR="${D}" $(flags_to_comps "install-headers-") + dodoc AUTHORS README COPYING +}
\ No newline at end of file diff --git a/dev-libs/GtkD/Manifest b/dev-libs/GtkD/Manifest new file mode 100644 index 0000000..3aaa1e3 --- /dev/null +++ b/dev-libs/GtkD/Manifest @@ -0,0 +1,3 @@ +AUX 2.3.0-makefile.patch 6108 SHA256 237639d61dd485a64aa405c7bd69fabb58e115b0317abfecd5e2678054c13c7d SHA512 782f2886bfb7082dab5902b8d94ade328133efd33b98f05e42a8002705f0c5d1b9a8f0d14dd87417df5f77fe8e9dcb3365977fa7e2329b3542a0e3d3fdbab778 WHIRLPOOL 9d2dadba73cda4508f01b22f7be1df6dd1cae7360a5367af964cdb9b303d2b3f7ce850e1b53d8a5c778dd458c94165b6f6aa9f229bda258fffbbdc8c80eb65f6 +DIST GtkD-2.3.0.zip 4188101 SHA256 2d7248b0fd482be70ca0400f6e82bd2e0189107e58242bee3cf8023bad0c1f88 SHA512 b37b80b5a72b5e4355f85b40e08b6617a19fbe1d1a6e87d30ee9c78af5f8afabf599e09c998581521bea14f1c50a35eedaeee958ac88a754cb1e40f544ead7d9 WHIRLPOOL 838306bdbc9e8a45f0823fdf381ac9990ef294df9e6229769b9bc8d9cea95c918079be13d44944e49a88199a90494c287343d5648ec75788a734d3c9cd685f74 +EBUILD GtkD-2.3.0.ebuild 1763 SHA256 c15126e8eda1c1e704c3236146e56e8983f77b666c78b9fded403ec7166271ef SHA512 a1c0ff3e27c3392b9ec47c55baaebc5aaf9a53a7b7deb6c02a991a3a826fc720678459387cce17f2d40b3652b02a3a2fdb87de3742c88372a283e6d10dd3f557 WHIRLPOOL e95948c6666e0694a062a2a1fa8f2c6577e500d3874b8b43d78d56e08fe8eb6ec17215c0a2efcb4de70d61a4137bf005642e2d42792fffc59a795a927982373e diff --git a/dev-libs/GtkD/files/2.3.0-makefile.patch b/dev-libs/GtkD/files/2.3.0-makefile.patch new file mode 100644 index 0000000..f2805b9 --- /dev/null +++ b/dev-libs/GtkD/files/2.3.0-makefile.patch @@ -0,0 +1,127 @@ +--- GNUmakefile ++++ GNUmakefile +@@ -1,6 +1,5 @@ + SHELL=/bin/sh +-prefix=/usr/local +-libdir=lib ++prefix=/usr + datadir=$(prefix)/share + + OS=$(shell uname || uname -s) +@@ -26,14 +25,12 @@ + + all: libs shared-libs gda gstreamer vte shared-gda shared-gstreamer shared-vte test + +-ifeq ("$(DC)","gdc") +- DCFLAGS=-O2 ++ifeq ("$(DLANG_VENDOR)","gdc") + LINKERFLAG=-Xlinker + DDOCFLAGS=-fsyntax-only -c -fdoc -fdoc-file=$@ + DDOCINC=-fdoc-inc= + output=-o $@ + else +- DCFLAGS=-O + LINKERFLAG=-L + DDOCFLAGS=-o- -Df$@ + output=-of$@ +@@ -246,8 +243,8 @@ + echo Name: GtkD > $@ + echo Description: A D binding and OO wrapper for GTK+. >> $@ + echo Version: $(GTKD_VERSION) >> $@ +- echo Libs: $(LINKERFLAG)-L$(prefix)/lib/ $(LINKERFLAG)-lgtkd-$(MAJOR) $(LINKERFLAG)-ldl >> $@ +- echo Cflags: -I$(prefix)/include/d/gtkd-$(MAJOR)/ >> $@ ++ echo Libs: $(LINKERFLAG)-lgtkd-$(MAJOR) $(LINKERFLAG)-ldl >> $@ ++ echo Cflags: -I$(DLANG_IMPORT_DIR)/gtkd-$(MAJOR)/ >> $@ + + gtkdgl-$(MAJOR).pc: + echo Name: GtkDGL > $@ +@@ -297,26 +294,26 @@ + endif + + install-gtkd: $(LIBNAME_GTKD) install-headers-gtkd +- install -d $(DESTDIR)$(prefix)/$(libdir) +- install -m 644 $(LIBNAME_GTKD) $(DESTDIR)$(prefix)/$(libdir) ++ install -d $(DESTDIR)$(DLANG_LIB_DIR) ++ install -m 644 $(LIBNAME_GTKD) $(DESTDIR)$(DLANG_LIB_DIR) + + install-gtkdgl: $(LIBNAME_GTKDGL) install-gtkd install-headers-gtkdgl +- install -m 644 $(LIBNAME_GTKDGL) $(DESTDIR)$(prefix)/$(libdir) ++ install -m 644 $(LIBNAME_GTKDGL) $(DESTDIR)$(DLANG_LIB_DIR) + + install-gtkdsv: $(LIBNAME_GTKDSV) install-gtkd install-headers-gtkdsv +- install -m 644 $(LIBNAME_GTKDSV) $(DESTDIR)$(prefix)/$(libdir) ++ install -m 644 $(LIBNAME_GTKDSV) $(DESTDIR)$(DLANG_LIB_DIR) + + install-gda: $(LIBNAME_GTKDGDA) install-gtkd install-headers-gda +- install -m 644 $(LIBNAME_GTKDGDA) $(DESTDIR)$(prefix)/$(libdir) ++ install -m 644 $(LIBNAME_GTKDGDA) $(DESTDIR)$(DLANG_LIB_DIR) + + install-gstreamer: $(LIBNAME_GSTREAMERD) install-gtkd install-headers-gstreamer +- install -m 644 $(LIBNAME_GSTREAMERD) $(DESTDIR)$(prefix)/$(libdir) ++ install -m 644 $(LIBNAME_GSTREAMERD) $(DESTDIR)$(DLANG_LIB_DIR) + + install-vte: $(LIBNAME_VTED) install-gtkd install-headers-vte +- install -m 644 $(LIBNAME_VTED) $(DESTDIR)$(prefix)/$(libdir) ++ install -m 644 $(LIBNAME_VTED) $(DESTDIR)$(DLANG_LIB_DIR) + + install-shared-gtkd: $(SONAME_GTKD) +- install -d $(DESTDIR)$(prefix)/$(libdir) ++ install -d $(DESTDIR)$(DLANG_LIB_DIR) + $(install-so) + + install-shared-gtkdgl: $(SONAME_GTKDGL) install-shared-gtkd +@@ -335,29 +332,29 @@ + $(install-so) + + install-headers-gtkd: gtkd-$(MAJOR).pc +- install -d $(DESTDIR)$(prefix)/include/d/gtkd-$(MAJOR) ++ install -d $(DESTDIR)$(DLANG_IMPORT_DIR)/gtkd-$(MAJOR) + install -d $(DESTDIR)$(datadir)/pkgconfig +- (cd src; echo $(SOURCES_GTKD) | sed -e s,src/,,g | xargs tar cf -) | (cd $(DESTDIR)$(prefix)/include/d/gtkd-$(MAJOR); tar xv) ++ (cd src; echo $(SOURCES_GTKD) | sed -e s,src/,,g | xargs tar cf -) | (cd $(DESTDIR)$(DLANG_IMPORT_DIR)/gtkd-$(MAJOR); tar xv) + install -m 644 gtkd-$(MAJOR).pc $(DESTDIR)$(datadir)/pkgconfig + + install-headers-gtkdgl: gtkdgl-$(MAJOR).pc install-headers-gtkd +- (cd srcgl; echo $(SOURCES_GTKDGL) | sed -e s,srcgl/,,g | xargs tar cf -) | (cd $(DESTDIR)$(prefix)/include/d/gtkd-$(MAJOR); tar xv) ++ (cd srcgl; echo $(SOURCES_GTKDGL) | sed -e s,srcgl/,,g | xargs tar cf -) | (cd $(DESTDIR)$(DLANG_IMPORT_DIR)/gtkd-$(MAJOR); tar xv) + install -m 644 gtkdgl-$(MAJOR).pc $(DESTDIR)$(datadir)/pkgconfig + + install-headers-gtkdsv: gtkdsv-$(MAJOR).pc install-headers-gtkd +- (cd srcsv; echo $(SOURCES_GTKDSV) | sed -e s,srcsv/,,g | xargs tar cf -) | (cd $(DESTDIR)$(prefix)/include/d/gtkd-$(MAJOR); tar xv) ++ (cd srcsv; echo $(SOURCES_GTKDSV) | sed -e s,srcsv/,,g | xargs tar cf -) | (cd $(DESTDIR)$(DLANG_IMPORT_DIR)/gtkd-$(MAJOR); tar xv) + install -m 644 gtkdsv-$(MAJOR).pc $(DESTDIR)$(datadir)/pkgconfig + + install-headers-gda: gtkdgda-$(MAJOR).pc install-headers-gtkd +- (cd srcgda; echo $(SOURCES_GTKDGDA) | sed -e s,srcgda/,,g | xargs tar cf -) | (cd $(DESTDIR)$(prefix)/include/d/gtkd-$(MAJOR); tar xv) ++ (cd srcgda; echo $(SOURCES_GTKDGDA) | sed -e s,srcgda/,,g | xargs tar cf -) | (cd $(DESTDIR)$(DLANG_IMPORT_DIR)/gtkd-$(MAJOR); tar xv) + install -m 644 gtkdgda-$(MAJOR).pc $(DESTDIR)$(datadir)/pkgconfig + + install-headers-gstreamer: gstreamerd-$(MAJOR).pc install-headers-gtkd +- (cd srcgstreamer; echo $(SOURCES_GSTREAMERD) | sed -e s,srcgstreamer/,,g | xargs tar cf -) | (cd $(DESTDIR)$(prefix)/include/d/gtkd-$(MAJOR); tar xv) ++ (cd srcgstreamer; echo $(SOURCES_GSTREAMERD) | sed -e s,srcgstreamer/,,g | xargs tar cf -) | (cd $(DESTDIR)$(DLANG_IMPORT_DIR)/gtkd-$(MAJOR); tar xv) + install -m 644 gstreamerd-$(MAJOR).pc $(DESTDIR)$(datadir)/pkgconfig + + install-headers-vte: vted-$(MAJOR).pc install-headers-gtkd +- (cd srcvte; echo $(SOURCES_VTED) | sed -e s,srcvte/,,g | xargs tar cf -) | (cd $(DESTDIR)$(prefix)/include/d/gtkd-$(MAJOR); tar xv) ++ (cd srcvte; echo $(SOURCES_VTED) | sed -e s,srcvte/,,g | xargs tar cf -) | (cd $(DESTDIR)$(DLANG_IMPORT_DIR)/gtkd-$(MAJOR); tar xv) + install -m 644 vted-$(MAJOR).pc $(DESTDIR)$(datadir)/pkgconfig + + uninstall: uninstall-gtkdgl uninstall-gtkdsv uninstall-gda uninstall-gstreamer +@@ -426,13 +423,13 @@ + + define make-shared-lib + #Remove this line when phobos #1280 is merged. +- $(if $(findstring "dmd","$(DC)"),$(eval LDFLAGS+=-defaultlib=:libphobos2.so)) ++ $(if $(findstring "dmd","$(DLANG_VENDOR)"),$(eval LDFLAGS+=-defaultlib=:libphobos2.so)) + + $(DC) -shared $(output) $(LDFLAGS) $(LINKERFLAG)-soname=$@.$(SO_VERSION) $^ + endef + + define install-so +- install -m 755 $< $(DESTDIR)$(prefix)/$(libdir)/$<.$(SO_VERSION).$(MINOR).$(BUGFIX) +- cd $(DESTDIR)$(prefix)/$(libdir)/; ln -s $<.$(SO_VERSION).$(MINOR).$(BUGFIX) $<.$(SO_VERSION) +- cd $(DESTDIR)$(prefix)/$(libdir)/; ln -s $<.$(SO_VERSION) $< ++ install -m 755 $< $(DESTDIR)$(DLANG_LIB_DIR)/$<.$(SO_VERSION).$(MINOR).$(BUGFIX) ++ cd $(DESTDIR)$(DLANG_LIB_DIR)/; ln -s $<.$(SO_VERSION).$(MINOR).$(BUGFIX) $<.$(SO_VERSION) ++ cd $(DESTDIR)$(DLANG_LIB_DIR)/; ln -s $<.$(SO_VERSION) $< + endef diff --git a/eclass/dlang.eclass b/eclass/dlang.eclass new file mode 100644 index 0000000..088f6fb --- /dev/null +++ b/eclass/dlang.eclass @@ -0,0 +1,331 @@ +# @ECLASS: dlang.eclass +# @MAINTAINER: marco.leise@gmx.de +# @BLURB: +# install D libraries in multiple locations for each D version and compiler +# @DESCRIPTION: +# The dlang eclass faciliates creating dependiencies on D libraries for use +# with different D compilers and D versions. + +if [[ ${___ECLASS_ONCE_DLANG} != "recur -_+^+_- spank" ]] ; then +___ECLASS_ONCE_DLANG="recur -_+^+_- spank" + +if has ${EAPI:-0} 0 1 2 3; then + die "EAPI must be >= 4 for dlang packages." +fi + +inherit multilib-minimal versionator + +EXPORT_FUNCTIONS src_configure src_compile src_test src_install + +export DLANG_IMPORT_DIR="/usr/include/dlang" + +dlang_convert_ldflags() { + if [[ "${DLANG_VENDOR}" == "dmd" ]] || [[ "${DLANG_VENDOR}" == "ldc" ]]; then + local set repl flags=() + if [[ is_dmd ]]; then + repl="-L" + elif [[ is_ldc ]]; then + repl="-L=" + fi + for set in ${LDFLAGS}; do + if [[ "${set:0:4}" == "-Wl," ]]; then + set=${set/-Wl,/${repl}} + flags+=(${set//,/ ${repl}}) + elif [[ "${set:0:8}" == "-Xlinker" ]]; then + flags+=(${set/-Xlinker/${repl}}) + elif [[ "${set:0:2}" == "-L" ]]; then + flags+=(${set/-L/${repl}-L}) + else + flags+=(${set}) + fi + done + echo "${flags[@]}" + elif [[ "${DLANG_VENDOR}" == "gdc" ]]; then + echo "${LDFLAGS}" + else + die "Set DLANG_VENDOR to dmd, ldc or gdc prior to calling ${FUNCNAME}()." + fi +} + +# @FUNCTION: dlang_foreach_config +# @DESCRIPTION: +# Function that calls its arguments for each D configuration. A few environment +# variables will be set for each call: +# ABI: See 'multilib_get_enabled_abis' from multilib-build.eclass. +# MODEL: This is either 32 or 64. +# DC: D compiler command. E.g. dmd2.064, ldc2-0.12.0 or +# /usr/x86_64-pc-linux-gnu/gcc-bin/4.8.1/x86_64-pc-linux-gnu-gdc +# DLANG_VENDOR: Either dmd, gdc or ldc. +# DC_VERSION: Release version of the compiler. This is the version excluding any +# Patch releases. So dmd 2.064.2 would still be 2.064. This version is used +# to separate potentially incompatible ABIs and to create the library path. +# Typical versions of gdc or ldc are 4.8.1 or 0.12.0. +# DLANG_VERSION: This differs from DC_VERSION in so far as it displays the +# front-end or language specification version for every compiler. Since the +# release of D1 it follows the scheme x.yyy and is as of writing at 2.064. +# DLANG_LIB_DIR: The compiler and compiler version specific library directory. +# DLANG_IMPORT_DIR: This is actually set globally. Place includes in a +# sub-directory. +dlang_foreach_config() { + debug-print-function ${FUNCNAME} "${@}" + + local MULTIBUILD_VARIANTS=() use_flag + # TODO: get some real compiler dependencies here. + for use_flag in ${USE}; do + case ${use_flag} in + dmd-* | gdc-* | ldc-* | ldc2-*) + for abi in $(multilib_get_enabled_abis); do + MULTIBUILD_VARIANTS+=("${abi}-${use_flag}") + done + ;; + esac + done + + multibuild_wrapper() { + debug-print-function ${FUNCNAME} "${@}" + + # We need to reset CC, else when dmd calls it, the result is: + # "x86_64-pc-linux-gnu-gcc -m32": No such file or directory + if [[ -v CC ]]; then + local __ORIGINAL_CC="${CC}" + fi + multilib_toolchain_setup "${ABI}" + if [[ -v __ORIGINAL_CC ]]; then + CC="${__ORIGINAL_CC}" + else + unset CC + fi + + # Now we define some variables and then call the function. + export ABI="$(echo ${MULTIBUILD_VARIANT} | cut -d- -f1)" + export DC="$(echo ${MULTIBUILD_VARIANT} | cut -d- -f2)" + export DC_VERSION="$(echo ${MULTIBUILD_VARIANT} | cut -d- -f3)" + export DLANG_VENDOR="${DC:0:3}" + export DLANG_VERSION="$(__dlang_compiler_to_dlang_version ${DC} ${DC_VERSION})" + [[ "${ABI:0:3}" == "x86" ]] && export MODEL=32 || export MODEL=64 + if [[ "${DLANG_VENDOR}" == "dmd" ]]; then + export DC="/opt/${DC}-${DC_VERSION}/bin/dmd" + export DLANG_LIB_DIR="/opt/dmd-${DC_VERSION}/$(get_libdir)" + export DCFLAGS="${DMDFLAGS}" + elif [[ "${DLANG_VENDOR}" == "gdc" ]]; then + export DC="/usr/${__DLANG_CHOST}/gcc-bin/${DC_VERSION}/${__DLANG_CHOST}-gdc" + if [[ "${MODEL}" == "32" ]]; then + export DLANG_LIB_DIR="/usr/lib/gcc/${__DLANG_CHOST}/${DC_VERSION}/32" + else + export DLANG_LIB_DIR="/usr/lib/gcc/${__DLANG_CHOST}/${DC_VERSION}" + fi + export DCFLAGS="${GDCFLAGS}" + elif [[ "${DLANG_VENDOR}" == "ldc" ]]; then + export DLANG_LIB_DIR="/opt/${DC}-${DC_VERSION}/$(get_libdir)" + export DC="/opt/${DC}-${DC_VERSION}/bin/ldc2" + export DCFLAGS="${LDCFLAGS}" + else + die "Could not detect D compiler vendor!" + fi + # We need to convert the LDFLAGS, so they are understood by DMD and LDC. + export LDFLAGS="$(dlang_convert_ldflags)" + "${@}" + } + + multibuild_foreach_variant multibuild_wrapper "${@}" +} + +# @FUNCTION: dlang_copy_sources +# @DESCRIPTION: +# Create a single copy of the package sources for each enabled D configuration. +dlang_copy_sources() { + debug-print-function ${FUNCNAME} "${@}" + + local MULTIBUILD_VARIANTS=($(__dlang_multibuild_configurations)) + multibuild_copy_sources +} + +dlang_has_shared_lib_support() { + if [[ "${DLANG_VENDOR}" == "dmd" ]]; then + [[ "$(get_major_version ${DLANG_VERSION})" -eq 2 ]] && [[ "$(get_after_major_version ${DLANG_VERSION})" -ge 063 ]] + elif [[ "${DLANG_VENDOR}" == "gdc" ]]; then + return 1 + elif [[ "${DLANG_VENDOR}" == "ldc" ]]; then + return 1 + else + die "Could not detect D compiler vendor!" + fi +} + +dlang_src_configure() { + __dlang_phase_wrapper configure +} + +dlang_src_compile() { + __dlang_phase_wrapper compile +} + +dlang_src_test() { + __dlang_phase_wrapper test +} + +dlang_src_install() { + __dlang_phase_wrapper install +} + +### Non-public helper functions ### + +# Generate arrays of all D versions +__DLANG_VERSIONS_1=() +__DLANG_VERSIONS_2=() +for v0 in {43..46} {48..59} 61 {63..82} 86 {88..178}; do + __DLANG_VERSIONS_1+=("0.${v0}") +done +for v1 in 00 {001..007} {009..076}; do + __DLANG_VERSIONS_1+=("1.${v1}") +done +for v2 in {000..023} {025..064}; do + __DLANG_VERSIONS_2+=("2.${v2}") +done +__DLANG_VERSIONS=("${__DLANG_VERSIONS_1[@]}" "${__DLANG_VERSIONS_2[@]}") + +__dlang_filter_versions() { + # Use given range to create a positive list of supported D versions + local ranges start stop d_version matches versions do_start + local -A valid + if [[ -v DLANG_VERSION_RANGE ]]; then + ranges=(${DLANG_VERSION_RANGE}) + for range in ${ranges[@]}; do + if [[ "${range}" == *?- ]]; then + start="${range%-}" + elif [[ "${range}" == -?* ]]; then + stop="${range#-}" + elif [[ "${range}" == *?-?* ]]; then + start="$(echo "${range}" | cut -d- -f1)" + stop="$(echo "${range}" | cut -d- -f2)" + else + start="${range}" + stop="${range}" + fi + matches=0 + do_start=0 + for i in 1 2; do + versions="__DLANG_VERSIONS_$i[@]" + for d_version in ${!versions}; do + if [[ $do_start -eq 0 ]] && [[ "${d_version}" == "${start}" ]] || [[ -z "${start}" ]]; then + do_start=1 + fi + if [[ $do_start -eq 1 ]]; then + valid[${d_version}]=1 + matches=$(( $matches+1 )) + fi + if [[ $do_start -eq 1 ]] && [[ "${d_version}" == "${stop}" ]]; then + do_start=2 + fi + done + if [[ do_start -eq 1 ]] && [[ -n "${stop}" ]]; then + die "Invalid end version in range '${range}'": + fi + done + [[ $matches -ne 0 ]] || die "Range '${range}' matches no D versions" + done + __DLANG_VERSIONS=(${!valid[@]}) + fi + + # Convert D versions to usable compilers and write IUSE + local compiler compilers=() depends=() + for d_version in ${__DLANG_VERSIONS[@]}; do + # DMD + case "${d_version}" in + "2.063") compiler="dmd-2.063" ;; + "2.064") compiler="dmd-2.064" ;; + *) compiler="" ;; + esac + if [[ -n "${compiler}" ]]; then + compilers+=("${compiler}") + depends+=("${compiler}? ( =dev-lang/${compiler}*:${d_version}[${MULTILIB_USEDEP}] )") + fi + # GDC + case "${d_version}" in + "2.063") compiler="gdc-4.8.1" ;; + *) compiler="" ;; + esac + if [[ -n "${compiler}" ]]; then + compilers+=("${compiler}") + depends+=("${compiler}? ( =sys-devel/${compiler/#gdc/gcc}*[d] )") + fi + # LDC + case "${d_version}" in + "2.063") compiler="ldc2-0.12.0" ;; + *) compiler="" ;; + esac + if [[ -n "${compiler}" ]]; then + compilers+=("${compiler}") + depends+=("${compiler}? ( =dev-lang/${compiler}* )") + fi + done + [[ ${#compilers[@]} -ne 0 ]] || die "No compilers found for D versions [${__DLANG_VERSIONS[@]}]" + IUSE="${compilers[@]}" + DEPEND="${depends[@]}" +} +__dlang_filter_versions + +# We will need the real CHOST to find GDC and its library path. +__DLANG_CHOST="${CHOST}" + +__dlang_phase_wrapper() { + dlang_multi() { + mkdir -p "${BUILD_DIR}" || die + pushd "${BUILD_DIR}" >/dev/null || die + if declare -f d_src_${1} >/dev/null ; then + d_src_${1} + else + default_src_${1} + fi + popd >/dev/null || die + } + + dlang_foreach_config dlang_multi "${1}" +} + +__dlang_compiler_to_dlang_version() { + local -rA gdc=( + ["4.8.1"]="2.063" + ) + local -rA ldc=( + ["0.12.0"]="1.076" + ) + local -rA ldc2=( + ["0.12.0"]="1.076" + ) + + case "${1}" in + "dmd") + echo "${2}" + ;; + "gdc") + echo "${gdc[${2}]}" + ;; + "ldc") + echo "${ldc[${2}]}" + ;; + "ldc2") + echo "${ldc2[${2}]}" + ;; + *) + die "Compiler '${1}' is unknown." + ;; + esac +} + +__dlang_multibuild_configurations() { + local MULTIBUILD_VARIANTS=() use_flag + # TODO: get some real compiler dependencies here. + for use_flag in ${USE}; do + case ${use_flag} in + dmd-* | gdc-* | ldc-* | ldc2-*) + for abi in $(multilib_get_enabled_abis); do + MULTIBUILD_VARIANTS+=("${abi}-${use_flag}") + done + ;; + esac + done + echo "${MULTIBUILD_VARIANTS[@]}" +} + +fi diff --git a/metadata/layout.conf b/metadata/layout.conf new file mode 100644 index 0000000..d43e61c --- /dev/null +++ b/metadata/layout.conf @@ -0,0 +1 @@ +masters = gentoo diff --git a/profiles/repo_name b/profiles/repo_name new file mode 100644 index 0000000..3cc2648 --- /dev/null +++ b/profiles/repo_name @@ -0,0 +1 @@ +dlang diff --git a/sys-devel/gcc/Manifest b/sys-devel/gcc/Manifest new file mode 100644 index 0000000..82e40cd --- /dev/null +++ b/sys-devel/gcc/Manifest @@ -0,0 +1,7 @@ +DIST ecj-4.5.jar 1470676 SHA256 98fd128f1d374d9e42fd9d4836bdd249c6d511ebc6c0df17fbc1b9df96c3d781 SHA512 d4e1bf7538ace56e3d69fa91da5bbd16c272923b4de0a9d8dee23ea2b75f9f38c603de72fc4061df49285c450b63f3df211cee5270e9fffc5447445d1a9c9e4e WHIRLPOOL db54206cfd5eba935e707b8d36ebac40f3c4ed3c1f06ede794288cbdd9c7da9d90c0898e8c98b383af276ea4c1b40c861ebd9e1fc1dce712946184321339d3ad +DIST gcc-4.4.3-specs-0.2.0.tar.bz2 2004 SHA256 f6c7cb99beead66dd4d06f7004c5731a9360330cbe878ce79792c618e008eed2 SHA512 779ecb0a064d2138b54569c8ae501975b8a6b72e5a3acbf8597619a8db77ee42ef9b0e62608d5192a15e4393e7dfc009bb50b994782236faa744b2c46b5fe517 WHIRLPOOL 8a1e45aad9d306cb19de93c63b5854a97e629d90852feb6861dcfca042b6257705304fc13ad65655a4cb227d36b83fc6063648c94f270821574ee0e85307094e +DIST gcc-4.8.1-patches-1.2.tar.bz2 17431 SHA256 964aed7e2c317be99eacbd0f4e7e619094f47ab48eb8844935c9a2c0a89d6bd6 SHA512 fec4237249021bfe040c148a72bf74df7f939baeafb804c87d9f0897c41e660bd8053d338ea994810a3c44c76d5eaa9269292f88b3603ab0d0a925c5073657d1 WHIRLPOOL 6bf6e4fc75536d9b0477780ba64a9ab8f2d6bc1000fb34e21dfe40e26e49b8ef9469370fcc5360f72dc780e3a187319e2f18fbc24fae3f294ff6983b32931666 +DIST gcc-4.8.1-piepatches-v0.5.7.tar.bz2 14260 SHA256 3edd9c0592716a5cd544af470c61448a0c5cb81d15ce0bfcf77e660a15546e60 SHA512 e471c852340cac7acef4540d0e2c266039e284952ec14cdb39cc732fd3572fed47f4912389f658916d9cb300ecd29d52734f2b7c003ef7acb33567af0211688c WHIRLPOOL fb95580a4969f3b447a4097d0ff86d243c71546e145ed7c290110a55339c2367fee2cb3f36b6a8c64e0f07d04c7a512f191eb2d7ab9e93aa759a8fd01d514317 +DIST gcc-4.8.1-uclibc-patches-1.0.tar.bz2 3004 SHA256 365b114f9fff51950a20870edeca0679bd0942ae4fe5d68b8ddc8e488d550aeb SHA512 b79ef258b0dc82286a5e246f7e02c3fe54f4445fe0ce723263853ce1f92a0c9fad4c254e09664d31472de7a7a6eb8e96225bc3a5613dd572ff1037d8c1668220 WHIRLPOOL 76f7485a01c0e81f9c20108c94ea40bcb6f7e739d2f5632eed92c1a2f3778cd620df2b9a663520ca6978c468d0ab6548f491c4ce515924f1e666798f002fee71 +DIST gcc-4.8.1.tar.bz2 86753166 SHA256 545b44be3ad9f2c4e90e6880f5c9d4f0a8f0e5f67e1ffb0d45da9fa01bb05813 SHA512 1becc874aad77a469069b6d9da4158aae9e013e24afa9364fe4feff9a5094d0673ee7694b3840e892c860f73a56b3ece6174338a8214438c42b9f86dd6c35ea7 WHIRLPOOL c706fa4445bbf4b9503c78b7e03da6adeadc3c736d208edb65059ddf23a08875dfa1ac92ccaafb3dd72ecbceb15a0de5814c62104fb94f99032232fbc50ab82c +EBUILD gcc-4.8.1.ebuild 2358 SHA256 e90e60a996e83828bd3b8a51abbd6f26d0eaff0438db1d5239f8d03d16656494 SHA512 8d76e03906db224ce764815cb48f914500651f02ced26a87eb18dbdffe51074eaec36184448c0a7497544b84e457db26054cbb1cb3fa2cfc00c765acec37fa72 WHIRLPOOL 73d5c091298f587cb7c181116ef8be84d818039596751ad9362d17a707b2f8b42289ba8e4ea12ee9ec40af8928a3c4c71e1fb17a93bee2b38fa26ea09a69cd90 diff --git a/sys-devel/gcc/gcc-4.8.1.ebuild b/sys-devel/gcc/gcc-4.8.1.ebuild new file mode 100644 index 0000000..dda51f2 --- /dev/null +++ b/sys-devel/gcc/gcc-4.8.1.ebuild @@ -0,0 +1,89 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EGIT_REPO_URI="git://github.com/D-Programming-GDC/GDC.git" +EGIT_BRANCH="gdc-4.8" +EGIT_COMMIT="6296cfbe97" +EGIT_SOURCEDIR="${WORKDIR}/dev" +EGIT_NOUNPACK=1 + +inherit git-2 + +IUSE="d" +FILESDIR=${PORTDIR}/sys-devel/gcc/files + +# Original GCC code starts here +PATCH_VER="1.2" +UCLIBC_VER="1.0" + +# Hardened gcc 4 stuff +PIE_VER="0.5.7" +SPECS_VER="0.2.0" +SPECS_GCC_VER="4.4.3" +# arch/libc configurations known to be stable with {PIE,SSP}-by-default +PIE_GLIBC_STABLE="x86 amd64 mips ppc ppc64 arm ia64" +PIE_UCLIBC_STABLE="x86 arm amd64 mips ppc ppc64" +SSP_STABLE="amd64 x86 mips ppc ppc64 arm" +# uclibc need tls and nptl support for SSP support +# uclibc need to be >= 0.9.33 +SSP_UCLIBC_STABLE="x86 amd64 mips ppc ppc64 arm" +#end Hardened stuff + +inherit toolchain + +DESCRIPTION="The GNU Compiler Collection" + +LICENSE="GPL-3+ LGPL-3+ || ( GPL-3+ libgcc libstdc++ gcc-runtime-library-exception-3.1 ) FDL-1.3+" + +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~mips ~x86 ~amd64-fbsd ~x86-fbsd" + +RDEPEND="" +DEPEND="${RDEPEND} + elibc_glibc? ( >=sys-libs/glibc-2.8 ) + >=${CATEGORY}/binutils-2.20" + +if [[ ${CATEGORY} != cross-* ]] ; then + PDEPEND="${PDEPEND} elibc_glibc? ( >=sys-libs/glibc-2.8 )" +fi + +src_unpack() { + if has_version '<sys-libs/glibc-2.12' ; then + ewarn "Your host glibc is too old; disabling automatic fortify." + ewarn "Please rebuild gcc after upgrading to >=glibc-2.12 #362315" + EPATCH_EXCLUDE+=" 10_all_default-fortify-source.patch" + fi + + toolchain_src_unpack + + use vanilla && return 0 + #Use -r1 for newer piepatchet that use DRIVER_SELF_SPECS for the hardened specs. + [[ ${CHOST} == ${CTARGET} ]] && epatch "${GCC_FILESDIR}"/gcc-spec-env-r1.patch + + if use d ; then + # Get GDC sources into the tree. + git-2_src_unpack + cd ../dev || die "Changing into Git checkout directory failed." + ./setup-gcc.sh ../gcc-${GCC_PV} || die "Could not setup GDC." + fi +} + +pkg_setup() { + toolchain_pkg_setup + + if use lto ; then + ewarn + ewarn "LTO support is still experimental and unstable. Any bug reports" + ewarn "about LTO that do not include an upstream patch will be closed as" + ewarn "invalid." + ewarn + fi +} + +pkg_postinst() { + toolchain_pkg_postinst + + elog + elog "Packages failing to build with GCC 4.8 are tracked at" + elog "https://bugs.gentoo.org/461954" + elog +} |