From 0691d49fb6e15740b8ddf8019fea4edb91bca914 Mon Sep 17 00:00:00 2001 From: "A. Unique TensorFlower" Date: Mon, 8 Oct 2018 10:43:54 -0700 Subject: Convert TensorFlow's nasm dependency to new third party import method. PiperOrigin-RevId: 216211467 --- third_party/nasm.BUILD | 168 -------------------------------------- third_party/nasm/BUILD | 1 + third_party/nasm/BUILD.bazel | 168 ++++++++++++++++++++++++++++++++++++++ third_party/nasm/BUILD.system | 12 +++ third_party/nasm/workspace.bzl | 17 ++++ third_party/systemlibs/nasm.BUILD | 12 --- 6 files changed, 198 insertions(+), 180 deletions(-) delete mode 100644 third_party/nasm.BUILD create mode 100644 third_party/nasm/BUILD create mode 100644 third_party/nasm/BUILD.bazel create mode 100644 third_party/nasm/BUILD.system create mode 100644 third_party/nasm/workspace.bzl delete mode 100644 third_party/systemlibs/nasm.BUILD (limited to 'third_party') diff --git a/third_party/nasm.BUILD b/third_party/nasm.BUILD deleted file mode 100644 index d746a65e7e..0000000000 --- a/third_party/nasm.BUILD +++ /dev/null @@ -1,168 +0,0 @@ -# Description: -# NASM is a portable assembler in the Intel/Microsoft tradition. - -licenses(["notice"]) # BSD 2-clause - -exports_files(["LICENSE"]) - -cc_binary( - name = "nasm", - srcs = [ - "asm/assemble.c", - "asm/assemble.h", - "asm/directbl.c", - "asm/directiv.c", - "asm/directiv.h", - "asm/error.c", - "asm/eval.c", - "asm/eval.h", - "asm/exprdump.c", - "asm/exprlib.c", - "asm/float.c", - "asm/float.h", - "asm/labels.c", - "asm/listing.c", - "asm/listing.h", - "asm/nasm.c", - "asm/parser.c", - "asm/parser.h", - "asm/pptok.c", - "asm/pptok.h", - "asm/pragma.c", - "asm/preproc.c", - "asm/preproc.h", - "asm/preproc-nop.c", - "asm/quote.c", - "asm/quote.h", - "asm/rdstrnum.c", - "asm/segalloc.c", - "asm/stdscan.c", - "asm/stdscan.h", - "asm/strfunc.c", - "asm/tokens.h", - "asm/tokhash.c", - "common/common.c", - "config/unknown.h", - "disasm/disasm.c", - "disasm/disasm.h", - "disasm/sync.c", - "disasm/sync.h", - "include/compiler.h", - "include/disp8.h", - "include/error.h", - "include/hashtbl.h", - "include/iflag.h", - "include/insns.h", - "include/labels.h", - "include/md5.h", - "include/nasm.h", - "include/nasmint.h", - "include/nasmlib.h", - "include/opflags.h", - "include/perfhash.h", - "include/raa.h", - "include/rbtree.h", - "include/rdoff.h", - "include/saa.h", - "include/strlist.h", - "include/tables.h", - "include/ver.h", - "macros/macros.c", - "nasmlib/badenum.c", - "nasmlib/bsi.c", - "nasmlib/crc64.c", - "nasmlib/file.c", - "nasmlib/file.h", - "nasmlib/filename.c", - "nasmlib/hashtbl.c", - "nasmlib/ilog2.c", - "nasmlib/malloc.c", - "nasmlib/md5c.c", - "nasmlib/mmap.c", - "nasmlib/path.c", - "nasmlib/perfhash.c", - "nasmlib/raa.c", - "nasmlib/rbtree.c", - "nasmlib/readnum.c", - "nasmlib/realpath.c", - "nasmlib/saa.c", - "nasmlib/srcfile.c", - "nasmlib/string.c", - "nasmlib/strlist.c", - "nasmlib/ver.c", - "nasmlib/zerobuf.c", - "output/codeview.c", - "output/dwarf.h", - "output/elf.h", - "output/legacy.c", - "output/nulldbg.c", - "output/nullout.c", - "output/outaout.c", - "output/outas86.c", - "output/outbin.c", - "output/outcoff.c", - "output/outdbg.c", - "output/outelf.c", - "output/outelf.h", - "output/outform.c", - "output/outform.h", - "output/outieee.c", - "output/outlib.c", - "output/outlib.h", - "output/outmacho.c", - "output/outobj.c", - "output/outrdf2.c", - "output/pecoff.h", - "output/stabs.h", - "stdlib/snprintf.c", - "stdlib/strlcpy.c", - "stdlib/strnlen.c", - "stdlib/vsnprintf.c", - "version.h", - "x86/disp8.c", - "x86/iflag.c", - "x86/iflaggen.h", - "x86/insnsa.c", - "x86/insnsb.c", - "x86/insnsd.c", - "x86/insnsi.h", - "x86/insnsn.c", - "x86/regdis.c", - "x86/regdis.h", - "x86/regflags.c", - "x86/regs.c", - "x86/regs.h", - "x86/regvals.c", - ] + select({ - ":windows": ["config/msvc.h"], - "//conditions:default": [], - }), - includes = [ - "asm", - "include", - "output", - "x86", - ], - copts = select({ - ":windows": [], - "//conditions:default": [ - "-w", - "-std=c99", - ], - }), - defines = select({ - ":windows": [], - "//conditions:default": [ - "HAVE_SNPRINTF", - "HAVE_SYS_TYPES_H", - ], - }), - visibility = ["@jpeg//:__pkg__"], -) - -config_setting( - name = "windows", - values = { - "cpu": "x64_windows", - }, -) diff --git a/third_party/nasm/BUILD b/third_party/nasm/BUILD new file mode 100644 index 0000000000..e3aec1fce9 --- /dev/null +++ b/third_party/nasm/BUILD @@ -0,0 +1 @@ +# Needed to make this a package. diff --git a/third_party/nasm/BUILD.bazel b/third_party/nasm/BUILD.bazel new file mode 100644 index 0000000000..c68d713946 --- /dev/null +++ b/third_party/nasm/BUILD.bazel @@ -0,0 +1,168 @@ +# Description: +# NASM is a portable assembler in the Intel/Microsoft tradition. + +licenses(["notice"]) # BSD 2-clause + +exports_files(["LICENSE"]) + +cc_binary( + name = "nasm", + srcs = [ + "asm/assemble.c", + "asm/assemble.h", + "asm/directbl.c", + "asm/directiv.c", + "asm/directiv.h", + "asm/error.c", + "asm/eval.c", + "asm/eval.h", + "asm/exprdump.c", + "asm/exprlib.c", + "asm/float.c", + "asm/float.h", + "asm/labels.c", + "asm/listing.c", + "asm/listing.h", + "asm/nasm.c", + "asm/parser.c", + "asm/parser.h", + "asm/pptok.c", + "asm/pptok.h", + "asm/pragma.c", + "asm/preproc.c", + "asm/preproc.h", + "asm/preproc-nop.c", + "asm/quote.c", + "asm/quote.h", + "asm/rdstrnum.c", + "asm/segalloc.c", + "asm/stdscan.c", + "asm/stdscan.h", + "asm/strfunc.c", + "asm/tokens.h", + "asm/tokhash.c", + "common/common.c", + "config/unknown.h", + "disasm/disasm.c", + "disasm/disasm.h", + "disasm/sync.c", + "disasm/sync.h", + "include/compiler.h", + "include/disp8.h", + "include/error.h", + "include/hashtbl.h", + "include/iflag.h", + "include/insns.h", + "include/labels.h", + "include/md5.h", + "include/nasm.h", + "include/nasmint.h", + "include/nasmlib.h", + "include/opflags.h", + "include/perfhash.h", + "include/raa.h", + "include/rbtree.h", + "include/rdoff.h", + "include/saa.h", + "include/strlist.h", + "include/tables.h", + "include/ver.h", + "macros/macros.c", + "nasmlib/badenum.c", + "nasmlib/bsi.c", + "nasmlib/crc64.c", + "nasmlib/file.c", + "nasmlib/file.h", + "nasmlib/filename.c", + "nasmlib/hashtbl.c", + "nasmlib/ilog2.c", + "nasmlib/malloc.c", + "nasmlib/md5c.c", + "nasmlib/mmap.c", + "nasmlib/path.c", + "nasmlib/perfhash.c", + "nasmlib/raa.c", + "nasmlib/rbtree.c", + "nasmlib/readnum.c", + "nasmlib/realpath.c", + "nasmlib/saa.c", + "nasmlib/srcfile.c", + "nasmlib/string.c", + "nasmlib/strlist.c", + "nasmlib/ver.c", + "nasmlib/zerobuf.c", + "output/codeview.c", + "output/dwarf.h", + "output/elf.h", + "output/legacy.c", + "output/nulldbg.c", + "output/nullout.c", + "output/outaout.c", + "output/outas86.c", + "output/outbin.c", + "output/outcoff.c", + "output/outdbg.c", + "output/outelf.c", + "output/outelf.h", + "output/outform.c", + "output/outform.h", + "output/outieee.c", + "output/outlib.c", + "output/outlib.h", + "output/outmacho.c", + "output/outobj.c", + "output/outrdf2.c", + "output/pecoff.h", + "output/stabs.h", + "stdlib/snprintf.c", + "stdlib/strlcpy.c", + "stdlib/strnlen.c", + "stdlib/vsnprintf.c", + "version.h", + "x86/disp8.c", + "x86/iflag.c", + "x86/iflaggen.h", + "x86/insnsa.c", + "x86/insnsb.c", + "x86/insnsd.c", + "x86/insnsi.h", + "x86/insnsn.c", + "x86/regdis.c", + "x86/regdis.h", + "x86/regflags.c", + "x86/regs.c", + "x86/regs.h", + "x86/regvals.c", + ] + select({ + ":windows": ["config/msvc.h"], + "//conditions:default": [], + }), + copts = select({ + ":windows": [], + "//conditions:default": [ + "-w", + "-std=c99", + ], + }), + defines = select({ + ":windows": [], + "//conditions:default": [ + "HAVE_SNPRINTF", + "HAVE_SYS_TYPES_H", + ], + }), + includes = [ + "asm", + "include", + "output", + "x86", + ], + visibility = ["@jpeg//:__pkg__"], +) + +config_setting( + name = "windows", + values = { + "cpu": "x64_windows", + }, +) diff --git a/third_party/nasm/BUILD.system b/third_party/nasm/BUILD.system new file mode 100644 index 0000000000..10ef8d8832 --- /dev/null +++ b/third_party/nasm/BUILD.system @@ -0,0 +1,12 @@ +licenses(["notice"]) # BSD 2-clause + +filegroup( + name = "LICENSE", + visibility = ["//visibility:public"], +) + +sh_binary( + name = "nasm", + srcs = ["nasm"], + visibility = ["@jpeg//:__pkg__"], +) diff --git a/third_party/nasm/workspace.bzl b/third_party/nasm/workspace.bzl new file mode 100644 index 0000000000..6d50f6fcad --- /dev/null +++ b/third_party/nasm/workspace.bzl @@ -0,0 +1,17 @@ +"""loads the nasm library, used by TF.""" + +load("//third_party:repo.bzl", "third_party_http_archive") + +def repo(): + third_party_http_archive( + name = "nasm", + urls = [ + "https://mirror.bazel.build/www.nasm.us/pub/nasm/releasebuilds/2.13.03/nasm-2.13.03.tar.bz2", + "http://pkgs.fedoraproject.org/repo/pkgs/nasm/nasm-2.13.03.tar.bz2/sha512/d7a6b4cee8dfd603d8d4c976e5287b5cc542fa0b466ff989b743276a6e28114e64289bf02a7819eca63142a5278aa6eed57773007e5f589e15768e6456a8919d/nasm-2.13.03.tar.bz2", + "http://www.nasm.us/pub/nasm/releasebuilds/2.13.03/nasm-2.13.03.tar.bz2", + ], + sha256 = "63ec86477ad3f0f6292325fd89e1d93aea2e2fd490070863f17d48f7cd387011", + strip_prefix = "nasm-2.13.03", + build_file = "//third_party/nasm:BUILD.bazel", + system_build_file = "//third_party/nasm:BUILD.system", + ) diff --git a/third_party/systemlibs/nasm.BUILD b/third_party/systemlibs/nasm.BUILD deleted file mode 100644 index 10ef8d8832..0000000000 --- a/third_party/systemlibs/nasm.BUILD +++ /dev/null @@ -1,12 +0,0 @@ -licenses(["notice"]) # BSD 2-clause - -filegroup( - name = "LICENSE", - visibility = ["//visibility:public"], -) - -sh_binary( - name = "nasm", - srcs = ["nasm"], - visibility = ["@jpeg//:__pkg__"], -) -- cgit v1.2.3